Skip to contentSkip to conversation

perf/core: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 3 participants 6 messages Feb 12, 2019 – Mar 9, 2019 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf/core: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

    kernel = 1;
    ~~~~~~~^~~

kernel/events/core.c:9156:3: note: here
case IF_SRC_FILEADDR:
^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 kernel/events/core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/events/core.c +1 -0
index ac194d3aae32..343ee21ab958 100644
@@ -9152,6 +9152,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 		case IF_SRC_KERNELADDR:
 		case IF_SRC_KERNEL:
 			kernel = 1;
+			/* fall through */
 
 		case IF_SRC_FILEADDR:
 		case IF_SRC_FILE:
Signature · 1 line
2.20.1
#1 lore raw

Hi all,

Friendly ping:

Who can ack or review this, please?

Thanks
--
Gustavo

Quoted 36 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

    kernel = 1;
    ~~~~~~~^~~
kernel/events/core.c:9156:3: note: here
   case IF_SRC_FILEADDR:
   ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 kernel/events/core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/events/core.c +1 -0
index ac194d3aae32..343ee21ab958 100644
@@ -9152,6 +9152,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 		case IF_SRC_KERNELADDR:
 		case IF_SRC_KERNEL:
 			kernel = 1;
+			/* fall through */
 
 		case IF_SRC_FILEADDR:
 		case IF_SRC_FILE:
#2 lore raw

Em Thu, Feb 28, 2019 at 03:31:31PM -0600, Gustavo A. R. Silva escreveu:

Quoted 5 lines

Hi all,

Friendly ping:

Who can ack or review this, please?

I'm applying it, thanks.

- Arnaldo

Quoted 41 lines

Thanks
--
Gustavo

Quoted 36 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

    kernel = 1;
    ~~~~~~~^~~
kernel/events/core.c:9156:3: note: here
   case IF_SRC_FILEADDR:
   ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 kernel/events/core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/events/core.c +1 -0
index ac194d3aae32..343ee21ab958 100644
@@ -9152,6 +9152,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 		case IF_SRC_KERNELADDR:
 		case IF_SRC_KERNEL:
 			kernel = 1;
+			/* fall through */
 
 		case IF_SRC_FILEADDR:
 		case IF_SRC_FILE:
Signature · 1 line
- Arnaldo
#3 lore raw
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Thu, Feb 28, 2019 at 03:31:31PM -0600, Gustavo A. R. Silva escreveu:

Quoted 5 lines

Hi all,

Friendly ping:

Who can ack or review this, please?

I'm applying it, thanks.

Great.

Thanks, Arnaldo.

--
Gustavo

#4 lore raw
In reply to Gustavo A. R. Silva
perf/core: Mark expected switch fall-through
Commit-ID:  43aa378b41700650e4ddbd068650f9fe4ab496df
Gitweb:     https://git.kernel.org/tip/43aa378b41700650e4ddbd068650f9fe4ab496df
Author:     Gustavo A. R. Silva <[email protected]>
AuthorDate: Tue, 12 Feb 2019 14:54:30 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 9 Mar 2019 14:10:32 +0100

perf/core: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

      kernel = 1;
      ~~~~~~~^~~
  kernel/events/core.c:9156:3: note: here
     case IF_SRC_FILEADDR:
     ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Cc Alexander Shishkin <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kees Cook <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Vince Weaver <[email protected]>
---
 kernel/events/core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/events/core.c +1 -0
index 5f59d848171e..68ff130b99e7 100644
@@ -9174,6 +9174,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 		case IF_SRC_KERNELADDR:
 		case IF_SRC_KERNEL:
 			kernel = 1;
+			/* fall through */
 
 		case IF_SRC_FILEADDR:
 		case IF_SRC_FILE:
#5 lore raw

[tip:perf/urgent] perf: Mark expected switch fall-through

In reply to Gustavo A. R. Silva
perf: Mark expected switch fall-through
Commit-ID:  10c3405f060397e565e4f75c403859f9a074bfa5
Gitweb:     https://git.kernel.org/tip/10c3405f060397e565e4f75c403859f9a074bfa5
Author:     Gustavo A. R. Silva <[email protected]>
AuthorDate: Tue, 12 Feb 2019 14:54:30 -0600
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 1 Mar 2019 10:54:00 -0300

perf: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]

      kernel = 1;
      ~~~~~~~^~~
  kernel/events/core.c:9156:3: note: here
     case IF_SRC_FILEADDR:
     ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 kernel/events/core.c | 1 +
 1 file changed, 1 insertion(+)
kernel/events/core.c +1 -0
index dd9698ad3d66..6fb27b564730 100644
@@ -9175,6 +9175,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 		case IF_SRC_KERNELADDR:
 		case IF_SRC_KERNEL:
 			kernel = 1;
+			/* fall through */
 
 		case IF_SRC_FILEADDR:
 		case IF_SRC_FILE: