Skip to content

Commit 25ee732

Browse files
Alexei Starovoitovdavem330
authored andcommitted
net: bpf: fix compiler warnings in test_bpf
old gcc 4.2 used by avr32 architecture produces warnings: lib/test_bpf.c:1741: warning: integer constant is too large for 'long' type lib/test_bpf.c:1741: warning: integer constant is too large for 'long' type lib/test_bpf.c: In function '__run_one': lib/test_bpf.c:1897: warning: 'ret' may be used uninitialized in this function silence these warnings. Fixes: 02ab695 ("net: filter: add "load 64-bit immediate" eBPF instruction") Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent de5df63 commit 25ee732

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/test_bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ static struct bpf_test tests[] = {
17381738
{
17391739
"load 64-bit immediate",
17401740
.u.insns_int = {
1741-
BPF_LD_IMM64(R1, 0x567800001234L),
1741+
BPF_LD_IMM64(R1, 0x567800001234LL),
17421742
BPF_MOV64_REG(R2, R1),
17431743
BPF_MOV64_REG(R3, R2),
17441744
BPF_ALU64_IMM(BPF_RSH, R2, 32),
@@ -1894,7 +1894,7 @@ static int __run_one(const struct bpf_prog *fp, const void *data,
18941894
int runs, u64 *duration)
18951895
{
18961896
u64 start, finish;
1897-
int ret, i;
1897+
int ret = 0, i;
18981898

18991899
start = ktime_to_us(ktime_get());
19001900

0 commit comments

Comments
 (0)