Skip to contentSkip to conversation

kdb: kdb_keyboard: mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Aug 5, 2018 – Aug 15, 2018 KGDB / KDB /debug_core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kdb: kdb_keyboard: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Notice that in this particular case, I replaced the code comments with a proper "fall through" annotation, which is what GCC is expecting to find.

---
 kernel/debug/kdb/kdb_keyboard.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/debug/kdb/kdb_keyboard.c +2 -2
index 118527a..750497b 100644
@@ -173,11 +173,11 @@ int kdb_get_kbd_char(void)
 	case KT_LATIN:
 		if (isprint(keychar))
 			break;		/* printable characters */
-		/* drop through */
+		/* fall through */
 	case KT_SPEC:
 		if (keychar == K_ENTER)
 			break;
-		/* drop through */
+		/* fall through */
 	default:
 		return -1;	/* ignore unprintables */
 	}
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Notice that in this particular case, I replaced the code comments with a proper "fall through" annotation, which is what GCC is expecting to find.

Quoted 23 lines
---
  kernel/debug/kdb/kdb_keyboard.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
kernel/debug/kdb/kdb_keyboard.c +2 -2
index 118527a..750497b 100644
@@ -173,11 +173,11 @@ int kdb_get_kbd_char(void)
  	case KT_LATIN:
  		if (isprint(keychar))
  			break;		/* printable characters */
-		/* drop through */
+		/* fall through */
  	case KT_SPEC:
  		if (keychar == K_ENTER)
  			break;
-		/* drop through */
+		/* fall through */
  	default:
  		return -1;	/* ignore unprintables */
  	}