summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/rbtree_fail.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-03-08 21:40:14 -0800
committerAlexei Starovoitov <ast@kernel.org>2023-03-10 08:14:08 -0800
commitc8ed66859397237c649998c58a68a86b8ea5f417 (patch)
tree9c13a073b663a889dcc205bceebbbbf49c0493fd /tools/testing/selftests/bpf/progs/rbtree_fail.c
parent713461b895ef958ef444b00cc2d979f3ca3a82e2 (diff)
downloadlwn-c8ed66859397237c649998c58a68a86b8ea5f417.tar.gz
lwn-c8ed66859397237c649998c58a68a86b8ea5f417.zip
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/rbtree_fail.c')
-rw-r--r--tools/testing/selftests/bpf/progs/rbtree_fail.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/rbtree_fail.c b/tools/testing/selftests/bpf/progs/rbtree_fail.c
index 1ced900f3fce..46d7d18a218f 100644
--- a/tools/testing/selftests/bpf/progs/rbtree_fail.c
+++ b/tools/testing/selftests/bpf/progs/rbtree_fail.c
@@ -105,7 +105,7 @@ long rbtree_api_remove_unadded_node(void *ctx)
}
SEC("?tc")
-__failure __msg("Unreleased reference id=2 alloc_insn=11")
+__failure __msg("Unreleased reference id=2 alloc_insn=10")
long rbtree_api_remove_no_drop(void *ctx)
{
struct bpf_rb_node *res;
@@ -119,6 +119,7 @@ long rbtree_api_remove_no_drop(void *ctx)
res = bpf_rbtree_remove(&groot, res);
n = container_of(res, struct node_data, node);
+ __sink(n);
bpf_spin_unlock(&glock);
/* bpf_obj_drop(n) is missing here */