Message ID | 20190306232526.219483-1-sdf@google.com |
---|---|
State | Accepted |
Delegated to: | BPF Maintainers |
Headers | show |
Series | [bpf] selftests: bpf: test_progs: initialize duration in singal_pending test | expand |
On Wed, Mar 6, 2019 at 3:25 PM Stanislav Fomichev <sdf@google.com> wrote: > > 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 <sdf@google.com> Acked-by: Yonghong Song <yhs@fb.com>
On 03/07/2019 12:25 AM, Stanislav Fomichev wrote: > 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 <sdf@google.com> Applied, thanks!
diff --git a/tools/testing/selftests/bpf/prog_tests/signal_pending.c b/tools/testing/selftests/bpf/prog_tests/signal_pending.c index f2a37bbf91ab..996e808f43a2 100644 --- a/tools/testing/selftests/bpf/prog_tests/signal_pending.c +++ b/tools/testing/selftests/bpf/prog_tests/signal_pending.c @@ -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;
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 <sdf@google.com> --- tools/testing/selftests/bpf/prog_tests/signal_pending.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)