selftests: bpf: test_progs: initialize duration in singal_pending test
authorStanislav Fomichev <[email protected]>
Wed, 6 Mar 2019 23:25:26 +0000 (15:25 -0800)
committerDaniel Borkmann <[email protected]>
Thu, 7 Mar 2019 09:46:25 +0000 (10:46 +0100)
CHECK macro implicitly uses duration. We call CHECK() a couple of times
before duration is initialized from bpf_prog_test_run().
Explicitly set duration to 0 to avoid compiler warnings.

Fixes: 740f8a657221 ("selftests/bpf: make sure signal interrupts BPF_PROG_TEST_RUN")
Signed-off-by: Stanislav Fomichev <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
tools/testing/selftests/bpf/prog_tests/signal_pending.c

index f2a37bbf91ab5b7818e87110bf478d928fe10e6a..996e808f43a26bd7409d3fa0102f89093b48d27e 100644 (file)
@@ -12,7 +12,7 @@ static void test_signal_pending_by_type(enum bpf_prog_type prog_type)
        struct itimerval timeo = {
                .it_value.tv_usec = 100000, /* 100ms */
        };
-       __u32 duration, retval;
+       __u32 duration = 0, retval;
        int prog_fd;
        int err;
        int i;