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
This commit is contained in:
Jiapeng Chong 2021-03-10 14:22:46 +08:00 committed by Andrii Nakryiko
parent c1acda9807
commit 04ea63e34a
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ struct Big {
__noinline int foo(const struct Big *big)
{
if (big == 0)
if (!big)
return 0;
return bpf_get_prandom_u32() < big->y;