OSDN Git Service

tools: Rename __fallthrough to fallthrough
authorLiam Howlett <liam.howlett@oracle.com>
Fri, 25 Nov 2022 15:50:16 +0000 (15:50 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 7 Apr 2023 00:41:00 +0000 (21:41 -0300)
commitf7a858bffcddaaf70c71b6b656e7cc21b6107cec
tree738f4bfb884378339292c1488b452cd592cf2293
parent0ea8920e86e3232c56dc812c1f363fd20fce46c6
tools: Rename __fallthrough to fallthrough

Rename the fallthrough attribute to better align with the kernel
version.  Copy the definition from include/linux/compiler_attributes.h
including the #else clause.  Adding the #else clause allows the tools
compiler.h header to drop the check for a definition entirely and keeps
both definitions together.

Change any __fallthrough statements to fallthrough anywhere it was used
within perf.

This allows other tools to use the same key word as the kernel.

Committer notes:

Did some missing conversions to:

  builtin-list.c

Also included gtk.h before the 'fallthrough' definition in:

  tools/perf/ui/gtk/hists.c
  tools/perf/ui/gtk/helpline.c
  tools/perf/ui/gtk/browser.c

As it is the arg name for a macro in glib.h:

  /var/home/acme/git/perf-tools-next/tools/include/linux/compiler-gcc.h:16:55: error: missing binary operator before token "("
     16 | # define fallthrough                    __attribute__((__fallthrough__))
        |                                                       ^
  /usr/include/glib-2.0/glib/gmacros.h:637:28: note: in expansion of macro â€˜fallthrough’
    637 | #if g_macro__has_attribute(fallthrough)

Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Tom Rix <trix@redhat.com>
Cc: linux-sparse@vger.kernel.org <linux-sparse@vger.kernel.org>
Cc: llvm@lists.linux.dev <llvm@lists.linux.dev>
Link: https://lore.kernel.org/r/20221125154947.2163498-1-Liam.Howlett@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
15 files changed:
tools/include/linux/compiler-gcc.h
tools/include/linux/compiler.h
tools/perf/builtin-list.c
tools/perf/builtin-probe.c
tools/perf/builtin-stat.c
tools/perf/builtin-top.c
tools/perf/ui/gtk/browser.c
tools/perf/ui/gtk/helpline.c
tools/perf/ui/gtk/hists.c
tools/perf/util/callchain.c
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
tools/perf/util/ordered-events.c
tools/perf/util/strfilter.c
tools/perf/util/string.c