selftests/bpf: fix lots of silly mistakes pointed out by compiler
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 9 Mar 2023 05:40:14 +0000 (21:40 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Mar 2023 16:14:08 +0000 (08:14 -0800)
commitc8ed66859397237c649998c58a68a86b8ea5f417
tree9c13a073b663a889dcc205bceebbbbf49c0493fd
parent713461b895ef958ef444b00cc2d979f3ca3a82e2
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>
81 files changed:
tools/testing/selftests/bpf/progs/bpf_iter_ksym.c
tools/testing/selftests/bpf/progs/bpf_iter_setsockopt.c
tools/testing/selftests/bpf/progs/bpf_loop.c
tools/testing/selftests/bpf/progs/cb_refs.c
tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
tools/testing/selftests/bpf/progs/cgrp_kfunc_failure.c
tools/testing/selftests/bpf/progs/cgrp_ls_attach_cgroup.c
tools/testing/selftests/bpf/progs/cgrp_ls_sleepable.c
tools/testing/selftests/bpf/progs/core_kern.c
tools/testing/selftests/bpf/progs/cpumask_failure.c
tools/testing/selftests/bpf/progs/cpumask_success.c
tools/testing/selftests/bpf/progs/dynptr_fail.c
tools/testing/selftests/bpf/progs/dynptr_success.c
tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c
tools/testing/selftests/bpf/progs/freplace_attach_probe.c
tools/testing/selftests/bpf/progs/iters.c
tools/testing/selftests/bpf/progs/linked_funcs1.c
tools/testing/selftests/bpf/progs/linked_funcs2.c
tools/testing/selftests/bpf/progs/linked_list.c
tools/testing/selftests/bpf/progs/linked_list_fail.c
tools/testing/selftests/bpf/progs/local_storage.c
tools/testing/selftests/bpf/progs/map_kptr.c
tools/testing/selftests/bpf/progs/netcnt_prog.c
tools/testing/selftests/bpf/progs/netif_receive_skb.c
tools/testing/selftests/bpf/progs/perfbuf_bench.c
tools/testing/selftests/bpf/progs/pyperf.h
tools/testing/selftests/bpf/progs/rbtree_btf_fail__wrong_node_type.c
tools/testing/selftests/bpf/progs/rbtree_fail.c
tools/testing/selftests/bpf/progs/rcu_read_lock.c
tools/testing/selftests/bpf/progs/read_bpf_task_storage_busy.c
tools/testing/selftests/bpf/progs/recvmsg4_prog.c
tools/testing/selftests/bpf/progs/recvmsg6_prog.c
tools/testing/selftests/bpf/progs/sendmsg4_prog.c
tools/testing/selftests/bpf/progs/sockmap_verdict_prog.c
tools/testing/selftests/bpf/progs/strobemeta.h
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf3.c
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c
tools/testing/selftests/bpf/progs/task_kfunc_failure.c
tools/testing/selftests/bpf/progs/task_kfunc_success.c
tools/testing/selftests/bpf/progs/test_bpf_nf.c
tools/testing/selftests/bpf/progs/test_cls_redirect_dynptr.c
tools/testing/selftests/bpf/progs/test_core_reloc_bitfields_probed.c
tools/testing/selftests/bpf/progs/test_global_func1.c
tools/testing/selftests/bpf/progs/test_global_func2.c
tools/testing/selftests/bpf/progs/test_hash_large_key.c
tools/testing/selftests/bpf/progs/test_ksyms_btf_write_check.c
tools/testing/selftests/bpf/progs/test_legacy_printk.c
tools/testing/selftests/bpf/progs/test_map_lock.c
tools/testing/selftests/bpf/progs/test_obj_id.c
tools/testing/selftests/bpf/progs/test_parse_tcp_hdr_opt.c
tools/testing/selftests/bpf/progs/test_parse_tcp_hdr_opt_dynptr.c
tools/testing/selftests/bpf/progs/test_pkt_access.c
tools/testing/selftests/bpf/progs/test_ringbuf.c
tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c
tools/testing/selftests/bpf/progs/test_ringbuf_multi.c
tools/testing/selftests/bpf/progs/test_select_reuseport_kern.c
tools/testing/selftests/bpf/progs/test_sk_assign.c
tools/testing/selftests/bpf/progs/test_sk_lookup.c
tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c
tools/testing/selftests/bpf/progs/test_sock_fields.c
tools/testing/selftests/bpf/progs/test_sockmap_kern.h
tools/testing/selftests/bpf/progs/test_spin_lock.c
tools/testing/selftests/bpf/progs/test_tc_dtime.c
tools/testing/selftests/bpf/progs/test_tc_neigh.c
tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c
tools/testing/selftests/bpf/progs/test_tunnel_kern.c
tools/testing/selftests/bpf/progs/test_usdt_multispec.c
tools/testing/selftests/bpf/progs/test_verif_scale1.c
tools/testing/selftests/bpf/progs/test_verif_scale2.c
tools/testing/selftests/bpf/progs/test_verif_scale3.c
tools/testing/selftests/bpf/progs/test_xdp_adjust_tail_grow.c
tools/testing/selftests/bpf/progs/test_xdp_bpf2bpf.c
tools/testing/selftests/bpf/progs/test_xdp_dynptr.c
tools/testing/selftests/bpf/progs/test_xdp_noinline.c
tools/testing/selftests/bpf/progs/test_xdp_vlan.c
tools/testing/selftests/bpf/progs/type_cast.c
tools/testing/selftests/bpf/progs/udp_limit.c
tools/testing/selftests/bpf/progs/user_ringbuf_success.c
tools/testing/selftests/bpf/progs/xdp_features.c
tools/testing/selftests/bpf/progs/xdping_kern.c
tools/testing/selftests/bpf/progs/xdpwall.c