* [PATCH] intel_th: Mark expected switch fall-throughs
@ 2019-02-12 21:43 Gustavo A. R. Silva
2019-02-20 18:12 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-12 21:43 UTC (permalink / raw)
To: Alexander Shishkin; +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 warnings:
drivers/hwtracing/intel_th/sth.c: In function ‘sth_stm_packet’:
drivers/hwtracing/intel_th/sth.c:86:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
reg += 4;
~~~~^~~~
drivers/hwtracing/intel_th/sth.c:87:2: note: here
case STP_PACKET_XSYNC:
^~~~
drivers/hwtracing/intel_th/sth.c:88:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
reg += 8;
~~~~^~~~
drivers/hwtracing/intel_th/sth.c:89:2: note: here
case STP_PACKET_TRIG:
^~~~
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>
---
drivers/hwtracing/intel_th/sth.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
index 4b7ae47789d2..3a1f4e650378 100644
--- a/drivers/hwtracing/intel_th/sth.c
+++ b/drivers/hwtracing/intel_th/sth.c
@@ -84,8 +84,12 @@ static ssize_t notrace sth_stm_packet(struct stm_data *stm_data,
/* Global packets (GERR, XSYNC, TRIG) are sent with register writes */
case STP_PACKET_GERR:
reg += 4;
+ /* fall through */
+
case STP_PACKET_XSYNC:
reg += 8;
+ /* fall through */
+
case STP_PACKET_TRIG:
if (flags & STP_PACKET_TIMESTAMPED)
reg += 4;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] intel_th: Mark expected switch fall-throughs
2019-02-12 21:43 [PATCH] intel_th: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-02-20 18:12 ` Gustavo A. R. Silva
2019-02-21 11:52 ` Alexander Shishkin
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-20 18:12 UTC (permalink / raw)
To: Alexander Shishkin; +Cc: linux-kernel, Kees Cook
Hi all,
Friendly ping:
Who can take this?
Thanks
--
Gustavo
On 2/12/19 3:43 PM, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warnings:
>
> drivers/hwtracing/intel_th/sth.c: In function ‘sth_stm_packet’:
> drivers/hwtracing/intel_th/sth.c:86:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> reg += 4;
> ~~~~^~~~
> drivers/hwtracing/intel_th/sth.c:87:2: note: here
> case STP_PACKET_XSYNC:
> ^~~~
> drivers/hwtracing/intel_th/sth.c:88:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> reg += 8;
> ~~~~^~~~
> drivers/hwtracing/intel_th/sth.c:89:2: note: here
> case STP_PACKET_TRIG:
> ^~~~
>
> 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>
> ---
> drivers/hwtracing/intel_th/sth.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
> index 4b7ae47789d2..3a1f4e650378 100644
> --- a/drivers/hwtracing/intel_th/sth.c
> +++ b/drivers/hwtracing/intel_th/sth.c
> @@ -84,8 +84,12 @@ static ssize_t notrace sth_stm_packet(struct stm_data *stm_data,
> /* Global packets (GERR, XSYNC, TRIG) are sent with register writes */
> case STP_PACKET_GERR:
> reg += 4;
> + /* fall through */
> +
> case STP_PACKET_XSYNC:
> reg += 8;
> + /* fall through */
> +
> case STP_PACKET_TRIG:
> if (flags & STP_PACKET_TIMESTAMPED)
> reg += 4;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] intel_th: Mark expected switch fall-throughs
2019-02-20 18:12 ` Gustavo A. R. Silva
@ 2019-02-21 11:52 ` Alexander Shishkin
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Shishkin @ 2019-02-21 11:52 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: linux-kernel, Kees Cook
"Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
> Hi all,
>
> Friendly ping:
>
> Who can take this?
I'll take it. Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-21 11:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 21:43 [PATCH] intel_th: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-02-20 18:12 ` Gustavo A. R. Silva
2019-02-21 11:52 ` Alexander Shishkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.