Skip to contentSkip to conversation

vt: annotate implicit fall throughs

PATCH In review Mathieu Malaterre 2 participants 2 messages Jan 14, 2019 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vt: annotate implicit fall throughs

There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warning:

drivers/tty/vt/vt.c:2112:6: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/tty/vt/vt.c:2237:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 drivers/tty/vt/vt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/vt/vt.c +2 -0
index 41ec8e5010f3..e4f8caed26af 100644
@@ -2111,6 +2111,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
 		lf(vc);
 		if (!is_kbd(vc, lnm))
 			return;
+		/* fall through */
 	case 13:
 		cr(vc);
 		return;
@@ -2236,6 +2237,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
 		vc->vc_ques = (c == '?');
 		if (vc->vc_ques)
 			return;
+		/* fall through */
 	case ESgetpars:
 		if (c == ';' && vc->vc_npar < NPAR - 1) {
 			vc->vc_npar++;
Signature · 1 line
2.19.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warning:

drivers/tty/vt/vt.c:2112:6: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/tty/vt/vt.c:2237:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Thanks, Mathieu.

--
Gustavo

Quoted 25 lines
---
  drivers/tty/vt/vt.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/tty/vt/vt.c +2 -0
index 41ec8e5010f3..e4f8caed26af 100644
@@ -2111,6 +2111,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
  		lf(vc);
  		if (!is_kbd(vc, lnm))
  			return;
+		/* fall through */
  	case 13:
  		cr(vc);
  		return;
@@ -2236,6 +2237,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
  		vc->vc_ques = (c == '?');
  		if (vc->vc_ques)
  			return;
+		/* fall through */
  	case ESgetpars:
  		if (c == ';' && vc->vc_npar < NPAR - 1) {
  			vc->vc_npar++;