Commit 25ee7327 authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by David S. Miller

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: 02ab695b ("net: filter: add "load 64-bit immediate" eBPF instruction")
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Acked-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de5df632
...@@ -1738,7 +1738,7 @@ static struct bpf_test tests[] = { ...@@ -1738,7 +1738,7 @@ static struct bpf_test tests[] = {
{ {
"load 64-bit immediate", "load 64-bit immediate",
.u.insns_int = { .u.insns_int = {
BPF_LD_IMM64(R1, 0x567800001234L), BPF_LD_IMM64(R1, 0x567800001234LL),
BPF_MOV64_REG(R2, R1), BPF_MOV64_REG(R2, R1),
BPF_MOV64_REG(R3, R2), BPF_MOV64_REG(R3, R2),
BPF_ALU64_IMM(BPF_RSH, R2, 32), BPF_ALU64_IMM(BPF_RSH, R2, 32),
...@@ -1894,7 +1894,7 @@ static int __run_one(const struct bpf_prog *fp, const void *data, ...@@ -1894,7 +1894,7 @@ static int __run_one(const struct bpf_prog *fp, const void *data,
int runs, u64 *duration) int runs, u64 *duration)
{ {
u64 start, finish; u64 start, finish;
int ret, i; int ret = 0, i;
start = ktime_to_us(ktime_get()); start = ktime_to_us(ktime_get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment