diff options
author | Joe Stringer <joe@wand.net.nz> | 2018-11-09 10:18:16 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-11-16 17:40:10 -0800 |
commit | 5c86d2125b58949122e03f04ce940e6f5b8534ba (patch) | |
tree | 01acfe764ce488de7056a4ed00ed0f92a769f96d | |
parent | 407be8d03e20d70d15cd8c21591202a591e3c2b2 (diff) | |
download | linux-5c86d2125b58949122e03f04ce940e6f5b8534ba.tar.gz linux-5c86d2125b58949122e03f04ce940e6f5b8534ba.tar.bz2 linux-5c86d2125b58949122e03f04ce940e6f5b8534ba.zip |
selftests/bpf: Fix uninitialized duration warning
Daniel Borkmann reports:
test_progs.c: In function ‘main’:
test_progs.c:81:3: warning: ‘duration’ may be used uninitialized in this function [-Wmaybe-uninitialized]
printf("%s:PASS:%s %d nsec\n", __func__, tag, duration);\
^~~~~~
test_progs.c:1706:8: note: ‘duration’ was declared here
__u32 duration;
^~~~~~~~
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | tools/testing/selftests/bpf/test_progs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 2d3c04f45530..c1e688f61061 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -1703,7 +1703,7 @@ static void test_reference_tracking() const char *file = "./test_sk_lookup_kern.o"; struct bpf_object *obj; struct bpf_program *prog; - __u32 duration; + __u32 duration = 0; int err = 0; obj = bpf_object__open(file); |