Commit 04ea63e3 authored by Jiapeng Chong's avatar Jiapeng Chong Committed by Andrii Nakryiko
Browse files

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: default avatarAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1615357366-97612-1-git-send-email-jiapeng.chong@linux.alibaba.com
parent c1acda98
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@ struct Big {


__noinline int foo(const struct Big *big)
__noinline int foo(const struct Big *big)
{
{
	if (big == 0)
	if (!big)
		return 0;
		return 0;


	return bpf_get_prandom_u32() < big->y;
	return bpf_get_prandom_u32() < big->y;