Make BPF-side compiler flags stricter by adding -Wall. Fix tons of small issues pointed out by compiler immediately after that. That includes newly added bpf_for(), bpf_for_each(), and bpf_repeat() macros. Andrii Nakryiko (4): selftests/bpf: prevent unused variable warning in bpf_for() selftests/bpf: add __sink() macro to fake variable consumption selftests/bpf: fix lots of silly mistakes pointed out by compiler selftests/bpf: make BPF compiler flags stricter tools/testing/selftests/bpf/Makefile | 4 +- .../selftests/bpf/progs/bpf_iter_ksym.c | 1 - .../selftests/bpf/progs/bpf_iter_setsockopt.c | 1 - tools/testing/selftests/bpf/progs/bpf_loop.c | 2 - tools/testing/selftests/bpf/progs/bpf_misc.h | 12 ++++-- tools/testing/selftests/bpf/progs/cb_refs.c | 1 - .../bpf/progs/cgroup_skb_sk_lookup_kern.c | 1 - .../selftests/bpf/progs/cgrp_kfunc_failure.c | 1 + .../bpf/progs/cgrp_ls_attach_cgroup.c | 1 - .../selftests/bpf/progs/cgrp_ls_sleepable.c | 1 - tools/testing/selftests/bpf/progs/core_kern.c | 2 +- .../selftests/bpf/progs/cpumask_failure.c | 3 ++ .../selftests/bpf/progs/cpumask_success.c | 1 - .../testing/selftests/bpf/progs/dynptr_fail.c | 5 ++- .../selftests/bpf/progs/dynptr_success.c | 5 +-- .../selftests/bpf/progs/fexit_bpf2bpf.c | 2 - .../bpf/progs/freplace_attach_probe.c | 2 +- tools/testing/selftests/bpf/progs/iters.c | 11 +++-- .../selftests/bpf/progs/linked_funcs1.c | 3 ++ .../selftests/bpf/progs/linked_funcs2.c | 3 ++ .../testing/selftests/bpf/progs/linked_list.c | 4 -- .../selftests/bpf/progs/linked_list_fail.c | 1 - .../selftests/bpf/progs/local_storage.c | 1 - tools/testing/selftests/bpf/progs/map_kptr.c | 3 -- .../testing/selftests/bpf/progs/netcnt_prog.c | 1 - .../selftests/bpf/progs/netif_receive_skb.c | 1 - .../selftests/bpf/progs/perfbuf_bench.c | 1 - tools/testing/selftests/bpf/progs/pyperf.h | 2 +- .../progs/rbtree_btf_fail__wrong_node_type.c | 11 ----- .../testing/selftests/bpf/progs/rbtree_fail.c | 3 +- .../selftests/bpf/progs/rcu_read_lock.c | 4 -- .../bpf/progs/read_bpf_task_storage_busy.c | 1 - .../selftests/bpf/progs/recvmsg4_prog.c | 2 - .../selftests/bpf/progs/recvmsg6_prog.c | 2 - .../selftests/bpf/progs/sendmsg4_prog.c | 2 - .../bpf/progs/sockmap_verdict_prog.c | 4 ++ .../testing/selftests/bpf/progs/strobemeta.h | 1 - .../selftests/bpf/progs/tailcall_bpf2bpf3.c | 11 +++++ .../selftests/bpf/progs/tailcall_bpf2bpf6.c | 3 ++ .../selftests/bpf/progs/task_kfunc_failure.c | 1 + .../selftests/bpf/progs/task_kfunc_success.c | 6 --- .../testing/selftests/bpf/progs/test_bpf_nf.c | 1 - .../bpf/progs/test_cls_redirect_dynptr.c | 1 - .../progs/test_core_reloc_bitfields_probed.c | 1 - .../selftests/bpf/progs/test_global_func1.c | 4 ++ .../selftests/bpf/progs/test_global_func2.c | 4 ++ .../selftests/bpf/progs/test_hash_large_key.c | 2 +- .../bpf/progs/test_ksyms_btf_write_check.c | 1 - .../selftests/bpf/progs/test_legacy_printk.c | 2 +- .../selftests/bpf/progs/test_map_lock.c | 2 +- .../testing/selftests/bpf/progs/test_obj_id.c | 2 + .../bpf/progs/test_parse_tcp_hdr_opt.c | 1 - .../bpf/progs/test_parse_tcp_hdr_opt_dynptr.c | 2 +- .../selftests/bpf/progs/test_pkt_access.c | 5 +++ .../selftests/bpf/progs/test_ringbuf.c | 1 - .../bpf/progs/test_ringbuf_map_key.c | 1 + .../selftests/bpf/progs/test_ringbuf_multi.c | 1 - .../bpf/progs/test_select_reuseport_kern.c | 2 +- .../selftests/bpf/progs/test_sk_assign.c | 4 +- .../selftests/bpf/progs/test_sk_lookup.c | 9 +--- .../selftests/bpf/progs/test_sk_lookup_kern.c | 2 - .../selftests/bpf/progs/test_sock_fields.c | 2 +- .../selftests/bpf/progs/test_sockmap_kern.h | 14 ++++-- .../selftests/bpf/progs/test_spin_lock.c | 3 ++ .../selftests/bpf/progs/test_tc_dtime.c | 4 +- .../selftests/bpf/progs/test_tc_neigh.c | 4 +- .../selftests/bpf/progs/test_tcpbpf_kern.c | 2 - .../selftests/bpf/progs/test_tunnel_kern.c | 6 --- .../selftests/bpf/progs/test_usdt_multispec.c | 2 - .../selftests/bpf/progs/test_verif_scale1.c | 2 +- .../selftests/bpf/progs/test_verif_scale2.c | 2 +- .../selftests/bpf/progs/test_verif_scale3.c | 2 +- .../bpf/progs/test_xdp_adjust_tail_grow.c | 2 - .../selftests/bpf/progs/test_xdp_bpf2bpf.c | 2 - .../selftests/bpf/progs/test_xdp_dynptr.c | 2 - .../selftests/bpf/progs/test_xdp_noinline.c | 43 ------------------- .../selftests/bpf/progs/test_xdp_vlan.c | 13 ------ tools/testing/selftests/bpf/progs/type_cast.c | 1 - tools/testing/selftests/bpf/progs/udp_limit.c | 2 - .../bpf/progs/user_ringbuf_success.c | 6 --- .../selftests/bpf/progs/xdp_features.c | 1 - .../testing/selftests/bpf/progs/xdping_kern.c | 2 - tools/testing/selftests/bpf/progs/xdpwall.c | 1 - 83 files changed, 101 insertions(+), 192 deletions(-) -- 2.34.1