Skip to contentSkip to conversation

selftests: bpf: test_progs: initialize duration in singal_pending test

PATCH Applied Stanislav Fomichev 3 participants 3 messages Mar 6, 2019 – Mar 7, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: bpf: test_progs: initialize duration in singal_pending test

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")
---
 tools/testing/selftests/bpf/prog_tests/signal_pending.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/signal_pending.c +1 -1
index f2a37bbf91ab..996e808f43a2 100644
@@ -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;
Signature · 1 line
2.21.0.352.gf09ad66450-goog
Acked-by Yonghong Song on v1 1/1
#1 lore raw
Quoted 8 lines · Stanislav Fomichev

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")
maintainer Applied
#2 lore raw
In reply to Stanislav Fomichev
Quoted 7 lines · Stanislav Fomichev

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")

Applied, thanks!