mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Remove redundant checks in get_stack_print_output()
@ 2022-04-05 16:37 Yuntao Wang
  2022-04-05 23:52 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Yuntao Wang @ 2022-04-05 16:37 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Shuah Khan, netdev, bpf, linux-kernel, linux-kselftest,
	Yuntao Wang

The checks preceding CHECK macro are redundant, remove them.

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
---
 tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
index 16048978a1ef..5f2ab720dabd 100644
--- a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
+++ b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
@@ -76,10 +76,8 @@ static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size)
 			good_user_stack = true;
 	}
 
-	if (!good_kern_stack)
-	    CHECK(!good_kern_stack, "kern_stack", "corrupted kernel stack\n");
-	if (!good_user_stack)
-	    CHECK(!good_user_stack, "user_stack", "corrupted user stack\n");
+	CHECK(!good_kern_stack, "kern_stack", "corrupted kernel stack\n");
+	CHECK(!good_user_stack, "user_stack", "corrupted user stack\n");
 }
 
 void test_get_stack_raw_tp(void)
-- 
2.35.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-06  3:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 16:37 [PATCH bpf-next] selftests/bpf: Remove redundant checks in get_stack_print_output() Yuntao Wang
2022-04-05 23:52 ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®