]> Git Repo - linux.git/commit
bpftool: Fix generated code in codegen_asserts
authorJiri Olsa <[email protected]>
Mon, 28 Mar 2022 08:37:03 +0000 (10:37 +0200)
committerAlexei Starovoitov <[email protected]>
Tue, 29 Mar 2022 02:10:25 +0000 (19:10 -0700)
commitef8a257b4e499a979364b1f9caf25a325f6ee8b8
treefae60c393eb15760ab96f796565f24f99fc78682
parent99dea2c664d7bc7e4f6f6947182d0d365165a998
bpftool: Fix generated code in codegen_asserts

Arnaldo reported perf compilation fail with:

  $ make -k BUILD_BPF_SKEL=1 CORESIGHT=1 PYTHON=python3
  ...
  In file included from util/bpf_counter.c:28:
  /tmp/build/perf//util/bpf_skel/bperf_leader.skel.h: In function ‘bperf_leader_bpf__assert’:
  /tmp/build/perf//util/bpf_skel/bperf_leader.skel.h:351:51: error: unused parameter ‘s’ [-Werror=unused-parameter]
    351 | bperf_leader_bpf__assert(struct bperf_leader_bpf *s)
        |                          ~~~~~~~~~~~~~~~~~~~~~~~~~^
  cc1: all warnings being treated as errors

If there's nothing to generate in the new assert function,
we will get unused 's' warn/error, adding 'unused' attribute to it.

Fixes: 08d4dba6ae77 ("bpftool: Bpf skeletons assert type sizes")
Reported-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
tools/bpf/bpftool/gen.c
This page took 0.059935 seconds and 4 git commands to generate.