diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-03-08 21:40:14 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-10 08:14:08 -0800 |
commit | c8ed66859397237c649998c58a68a86b8ea5f417 (patch) | |
tree | 9c13a073b663a889dcc205bceebbbbf49c0493fd /tools/testing/selftests/bpf/progs/test_xdp_vlan.c | |
parent | 713461b895ef958ef444b00cc2d979f3ca3a82e2 (diff) | |
download | linux-c8ed66859397237c649998c58a68a86b8ea5f417.tar.gz linux-c8ed66859397237c649998c58a68a86b8ea5f417.tar.bz2 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_xdp_vlan.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_xdp_vlan.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_xdp_vlan.c b/tools/testing/selftests/bpf/progs/test_xdp_vlan.c index 4ddcb6dfe500..f3ec8086482d 100644 --- a/tools/testing/selftests/bpf/progs/test_xdp_vlan.c +++ b/tools/testing/selftests/bpf/progs/test_xdp_vlan.c @@ -210,19 +210,6 @@ int xdp_prognum2(struct xdp_md *ctx) } static __always_inline -void shift_mac_4bytes_16bit(void *data) -{ - __u16 *p = data; - - p[7] = p[5]; /* delete p[7] was vlan_hdr->h_vlan_TCI */ - p[6] = p[4]; /* delete p[6] was ethhdr->h_proto */ - p[5] = p[3]; - p[4] = p[2]; - p[3] = p[1]; - p[2] = p[0]; -} - -static __always_inline void shift_mac_4bytes_32bit(void *data) { __u32 *p = data; |