* [PATCH net-next] net: bpf: fix compiler warnings in test_bpf
@ 2014-09-19 20:53 Alexei Starovoitov
2014-09-19 20:56 ` Daniel Borkmann
2014-09-22 20:22 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2014-09-19 20:53 UTC (permalink / raw)
To: David S. Miller; +Cc: Daniel Borkmann, Fengguang Wu, netdev
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: 02ab695bb37e ("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>
---
lib/test_bpf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 413890815d3e..23e070bcf72d 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -1738,7 +1738,7 @@ static struct bpf_test tests[] = {
{
"load 64-bit immediate",
.u.insns_int = {
- BPF_LD_IMM64(R1, 0x567800001234L),
+ BPF_LD_IMM64(R1, 0x567800001234LL),
BPF_MOV64_REG(R2, R1),
BPF_MOV64_REG(R3, R2),
BPF_ALU64_IMM(BPF_RSH, R2, 32),
@@ -1894,7 +1894,7 @@ static int __run_one(const struct bpf_prog *fp, const void *data,
int runs, u64 *duration)
{
u64 start, finish;
- int ret, i;
+ int ret = 0, i;
start = ktime_to_us(ktime_get());
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: bpf: fix compiler warnings in test_bpf
2014-09-19 20:53 [PATCH net-next] net: bpf: fix compiler warnings in test_bpf Alexei Starovoitov
@ 2014-09-19 20:56 ` Daniel Borkmann
2014-09-22 20:22 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2014-09-19 20:56 UTC (permalink / raw)
To: Alexei Starovoitov; +Cc: David S. Miller, Fengguang Wu, netdev
On 09/19/2014 10:53 PM, Alexei Starovoitov wrote:
> 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: 02ab695bb37e ("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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: bpf: fix compiler warnings in test_bpf
2014-09-19 20:53 [PATCH net-next] net: bpf: fix compiler warnings in test_bpf Alexei Starovoitov
2014-09-19 20:56 ` Daniel Borkmann
@ 2014-09-22 20:22 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-09-22 20:22 UTC (permalink / raw)
To: ast; +Cc: dborkman, fengguang.wu, netdev
From: Alexei Starovoitov <ast@plumgrid.com>
Date: Fri, 19 Sep 2014 13:53:51 -0700
> 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: 02ab695bb37e ("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>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-22 20:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19 20:53 [PATCH net-next] net: bpf: fix compiler warnings in test_bpf Alexei Starovoitov
2014-09-19 20:56 ` Daniel Borkmann
2014-09-22 20:22 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.