* [PATCH] tracing: Mark expected switch fall-through
@ 2019-02-12 21:08 Gustavo A. R. Silva
2019-02-13 14:02 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-12 21:08 UTC (permalink / raw)
To: Steven Rostedt, Ingo Molnar; +Cc: linux-kernel, Gustavo A. R. Silva, Kees Cook
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.
This patch fixes the following warning:
kernel/trace/trace_events_filter.c: In function ‘predicate_parse’:
kernel/trace/trace_events_filter.c:494:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (next[1] == next[0]) {
^
kernel/trace/trace_events_filter.c:498:4: note: here
default:
^~~~~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
kernel/trace/trace_events_filter.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 27821480105e..eb694756c4bb 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -495,6 +495,7 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
ptr++;
break;
}
+ /* fall through */
default:
parse_error(pe, FILT_ERR_TOO_MANY_PREDS,
next - str);
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tracing: Mark expected switch fall-through
2019-02-12 21:08 [PATCH] tracing: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-02-13 14:02 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2019-02-13 14:02 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Ingo Molnar, linux-kernel, Kees Cook
On Tue, 12 Feb 2019 15:08:03 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> kernel/trace/trace_events_filter.c: In function ‘predicate_parse’:
> kernel/trace/trace_events_filter.c:494:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (next[1] == next[0]) {
> ^
> kernel/trace/trace_events_filter.c:498:4: note: here
> default:
> ^~~~~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
Thanks, but I've already applied this patch:
http://lkml.kernel.org/r/20190114203039.16535-2-malat@debian.org
I just haven't run my queue through my tests to push it to linux-next
yet.
-- Steve
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> kernel/trace/trace_events_filter.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
> index 27821480105e..eb694756c4bb 100644
> --- a/kernel/trace/trace_events_filter.c
> +++ b/kernel/trace/trace_events_filter.c
> @@ -495,6 +495,7 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
> ptr++;
> break;
> }
> + /* fall through */
> default:
> parse_error(pe, FILT_ERR_TOO_MANY_PREDS,
> next - str);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-13 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 21:08 [PATCH] tracing: Mark expected switch fall-through Gustavo A. R. Silva
2019-02-13 14:02 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).