aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_sk_lookup_kern.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/test_sk_lookup_kern.c
parentselftests/bpf: add __sink() macro to fake variable consumption (diff)
downloadlinux-c8ed66859397237c649998c58a68a86b8ea5f417.tar.xz
linux-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/test_sk_lookup_kern.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c b/tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c
index 6ccf6d546074..e9efc3263022 100644
--- a/tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c
+++ b/tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c
@@ -110,7 +110,6 @@ int err_modify_sk_pointer(struct __sk_buff *skb)
{
struct bpf_sock_tuple tuple = {};
struct bpf_sock *sk;
- __u32 family;
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
if (sk) {
@@ -125,7 +124,6 @@ int err_modify_sk_or_null_pointer(struct __sk_buff *skb)
{
struct bpf_sock_tuple tuple = {};
struct bpf_sock *sk;
- __u32 family;
sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
sk += 1;