Skip to contentSkip to conversation

perf top: Use __fallthrough

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Feb 10, 2017 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  7b0214b702ad8e124e039a317beeebb3f020d125
Gitweb:     http://git.kernel.org/tip/7b0214b702ad8e124e039a317beeebb3f020d125
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 8 Feb 2017 17:01:46 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 8 Feb 2017 17:31:22 -0300

perf top: Use __fallthrough

The implicit fall through case label here is intended, so let us inform that to gcc >= 7:

CC /tmp/build/perf/builtin-top.o
builtin-top.c: In function 'display_thread':
builtin-top.c:644:7: error: this statement may fall through [-Werror=implicit-fallthrough=]

      if (errno == EINTR)
         ^

builtin-top.c:647:3: note: here
default:
^~~~~~~

---
 tools/perf/builtin-top.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-top.c +1 -1
index 20aef98..d90927f 100644
@@ -643,7 +643,7 @@ repeat:
 		case -1:
 			if (errno == EINTR)
 				continue;
-			/* Fall trhu */
+			__fallthrough;
 		default:
 			c = getc(stdin);
 			tcsetattr(0, TCSAFLUSH, &save);