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>
This commit is contained in:
Родитель
407be8d03e
Коммит
5c86d2125b
|
@ -1703,7 +1703,7 @@ static void test_reference_tracking()
|
||||||
const char *file = "./test_sk_lookup_kern.o";
|
const char *file = "./test_sk_lookup_kern.o";
|
||||||
struct bpf_object *obj;
|
struct bpf_object *obj;
|
||||||
struct bpf_program *prog;
|
struct bpf_program *prog;
|
||||||
__u32 duration;
|
__u32 duration = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
obj = bpf_object__open(file);
|
obj = bpf_object__open(file);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче