diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-03-09 08:40:14 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-10 19:14:08 +0300 |
commit | c8ed66859397237c649998c58a68a86b8ea5f417 (patch) | |
tree | 9c13a073b663a889dcc205bceebbbbf49c0493fd /tools/testing/selftests/bpf/progs/test_spin_lock.c | |
parent | 713461b895ef958ef444b00cc2d979f3ca3a82e2 (diff) | |
download | linux-c8ed66859397237c649998c58a68a86b8ea5f417.tar.xz |
selftests/bpf: fix lots of silly mistakes pointed out by compiler
Once we enable -Wall for BPF sources, compiler will complain about lots
of unused variables, variables that are set but never read, etc.
Fix all these issues first before enabling -Wall in Makefile.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230309054015.4068562-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_spin_lock.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_spin_lock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_spin_lock.c b/tools/testing/selftests/bpf/progs/test_spin_lock.c index 5bd10409285b..b2440a0ff422 100644 --- a/tools/testing/selftests/bpf/progs/test_spin_lock.c +++ b/tools/testing/selftests/bpf/progs/test_spin_lock.c @@ -3,6 +3,7 @@ #include <linux/bpf.h> #include <linux/version.h> #include <bpf/bpf_helpers.h> +#include "bpf_misc.h" struct hmap_elem { volatile int cnt; @@ -89,6 +90,8 @@ int bpf_spin_lock_test(struct __sk_buff *skb) credit = q->credit; bpf_spin_unlock(&q->lock); + __sink(credit); + /* spin_lock in cgroup local storage */ cls = bpf_get_local_storage(&cls_map, 0); bpf_spin_lock(&cls->lock); |