Skip to contentSkip to conversation

intel_th: Mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Feb 12, 2019 – Feb 21, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel_th: Mark expected switch fall-throughs

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.

---
 drivers/hwtracing/intel_th/sth.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hwtracing/intel_th/sth.c +4 -0
index 4b7ae47789d2..3a1f4e650378 100644
@@ -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;
Signature · 1 line
2.20.1
#1 lore raw

Hi all,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

Quoted 47 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 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.

---
 drivers/hwtracing/intel_th/sth.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hwtracing/intel_th/sth.c +4 -0
index 4b7ae47789d2..3a1f4e650378 100644
@@ -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 lore raw
Quoted 5 lines · Gustavo A. R. Silva

Hi all,

Friendly ping:

Who can take this?

I'll take it. Thanks!