Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix warning comparing pointer to 0

Fix the following coccicheck warning:

./tools/testing/selftests/bpf/progs/test_global_func10.c:17:12-13:
WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1615357366-97612-1-git-send-email-jiapeng.chong@linux.alibaba.com

authored by

Jiapeng Chong and committed by
Andrii Nakryiko
04ea63e3 c1acda98

+1 -1
+1 -1
tools/testing/selftests/bpf/progs/test_global_func10.c
··· 14 14 15 15 __noinline int foo(const struct Big *big) 16 16 { 17 - if (big == 0) 17 + if (!big) 18 18 return 0; 19 19 20 20 return bpf_get_prandom_u32() < big->y;