Skip to contentSkip to conversation

net: hamradio: baycom_epp: Mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Jul 29, 2019

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

PATCH 1/1 net: hamradio: baycom_epp: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: i386):

drivers/net/hamradio/baycom_epp.c: In function ‘transmit’:
drivers/net/hamradio/baycom_epp.c:491:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (i) {
       ^

drivers/net/hamradio/baycom_epp.c:504:3: note: here
default: /* fall through */
^~~~~~~

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

---
 drivers/net/hamradio/baycom_epp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/hamradio/baycom_epp.c +2 -1
index daab2c07d891..9303aeb2595f 100644
@@ -500,8 +500,9 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
 				}
 				break;
 			}
+			/* fall through */
 
-		default:  /* fall through */
+		default:
 			if (bc->hdlctx.calibrate <= 0)
 				return 0;
 			i = min_t(int, cnt, bc->hdlctx.calibrate);
Signature · 1 line
2.22.0
maintainer Applied
#1 lore raw

From: "Gustavo A. R. Silva" <[email protected]>
Date: Mon, 29 Jul 2019 15:12:31 -0500

Quoted 8 lines

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: i386):

drivers/net/hamradio/baycom_epp.c: In function ¡transmit¢:
drivers/net/hamradio/baycom_epp.c:491:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (i) {
       ^
Quoted 8 lines

drivers/net/hamradio/baycom_epp.c:504:3: note: here
default: /* fall through */
^~~~~~~

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

Applied.