MIPS: perf events: handle switch statement falling through warnings
authorStephen Rothwell <sfr@canb.auug.org.au>
Mon, 15 Jul 2019 10:55:04 +0000 (11:55 +0100)
committerPaul Burton <paul.burton@mips.com>
Mon, 15 Jul 2019 11:05:51 +0000 (12:05 +0100)
commit03bcba73cb3c223ea8ab8d7f33bd85545e47fc75
tree0989c7da98ce0a95edabbc9b95ada5644c704aa5
parentc9093486f283c3447439f234eb0124129e8e7834
MIPS: perf events: handle switch statement falling through warnings

Now that we build with -Wimplicit-fallthrough=3, some warnings are
produced in the arch/mips perf events code that are promoted to errors:

 arch/mips/kernel/perf_event_mipsxx.c:792:3: error: this statement may fall through [-Werror=implicit-fallthrough=]
 arch/mips/kernel/perf_event_mipsxx.c:795:3: error: this statement may fall through [-Werror=implicit-fallthrough=]
 arch/mips/kernel/perf_event_mipsxx.c:798:3: error: this statement may fall through [-Werror=implicit-fallthrough=]
 arch/mips/kernel/perf_event_mipsxx.c:1407:6: error: this statement may fall through [-Werror=implicit-fallthrough=]

Assume the fall throughs are deliberate amd annotate/eliminate them.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
[paul.burton@mips.com:
  - Make n signed to fix the loop condition.
  - Simplify the initialization of n, which should never have a value
    greater than 4.
  - Invert conditions in the loop to decrease indentation.]
Signed-off-by: Paul Burton <paul.burton@mips.com>
arch/mips/kernel/perf_event_mipsxx.c