diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2021-03-10 08:18:34 +0100 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-03-10 22:37:33 +0100 |
commit | a9c80b03e586fd3819089fbd33c38fb65ad5e00c (patch) | |
tree | 9d45403f7d40301263966e1e3bdf700c438d8d8f /tools | |
parent | selftests/bpf: Fix warning comparing pointer to 0 (diff) | |
download | linux-a9c80b03e586fd3819089fbd33c38fb65ad5e00c.tar.xz linux-a9c80b03e586fd3819089fbd33c38fb65ad5e00c.zip |
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')
-rw-r--r-- | tools/testing/selftests/bpf/progs/fentry_test.c | 2 |
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; } |