summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/fentry_test.c
diff options
context:
space:
mode:
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>2021-03-10 15:18:34 +0800
committerAndrii Nakryiko <andrii@kernel.org>2021-03-10 13:37:33 -0800
commita9c80b03e586fd3819089fbd33c38fb65ad5e00c (patch)
tree9d45403f7d40301263966e1e3bdf700c438d8d8f /tools/testing/selftests/bpf/progs/fentry_test.c
parent04ea63e34a2ee85cfd38578b3fc97b2d4c9dd573 (diff)
bpf: Fix warning comparing pointer to 0
Fix the following coccicheck warning: ./tools/testing/selftests/bpf/progs/fentry_test.c:67: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/1615360714-30381-1-git-send-email-jiapeng.chong@linux.alibaba.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/fentry_test.c')
-rw-r--r--tools/testing/selftests/bpf/progs/fentry_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/fentry_test.c b/tools/testing/selftests/bpf/progs/fentry_test.c
index 5f645fdaba6f..52a550d281d9 100644
--- a/tools/testing/selftests/bpf/progs/fentry_test.c
+++ b/tools/testing/selftests/bpf/progs/fentry_test.c
@@ -64,7 +64,7 @@ __u64 test7_result = 0;
SEC("fentry/bpf_fentry_test7")
int BPF_PROG(test7, struct bpf_fentry_test_t *arg)
{
- if (arg == 0)
+ if (!arg)
test7_result = 1;
return 0;
}