Skip to content

Commit ccaa751

Browse files
memstick: 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/memstick/host/jmb38x_ms.c: In function ‘jmb38x_ms_write_data’: drivers/memstick/host/jmb38x_ms.c:261:15: warning: this statement may fall through [-Wimplicit-fallthrough=] host->io_pos++; ~~~~~~~~~~~~^~ drivers/memstick/host/jmb38x_ms.c:262:2: note: here case 2: ^~~~ drivers/memstick/host/jmb38x_ms.c:264:15: warning: this statement may fall through [-Wimplicit-fallthrough=] host->io_pos++; ~~~~~~~~~~~~^~ drivers/memstick/host/jmb38x_ms.c:265:2: note: here case 1: ^~~~ drivers/memstick/host/tifm_ms.c: In function ‘tifm_ms_write_data’: drivers/memstick/host/tifm_ms.c:168:15: warning: this statement may fall through [-Wimplicit-fallthrough=] host->io_pos++; ~~~~~~~~~~~~^~ drivers/memstick/host/tifm_ms.c:169:2: note: here case 2: ^~~~ drivers/memstick/host/tifm_ms.c:171:15: warning: this statement may fall through [-Wimplicit-fallthrough=] host->io_pos++; ~~~~~~~~~~~~^~ drivers/memstick/host/tifm_ms.c:172:2: note: here case 1: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
1 parent 322b38c commit ccaa751

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/memstick/host/jmb38x_ms.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
259259
case 3:
260260
host->io_word[0] |= buf[off + 2] << 16;
261261
host->io_pos++;
262+
/* fall through */
262263
case 2:
263264
host->io_word[0] |= buf[off + 1] << 8;
264265
host->io_pos++;
266+
/* fall through */
265267
case 1:
266268
host->io_word[0] |= buf[off];
267269
host->io_pos++;

‎drivers/memstick/host/tifm_ms.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
166166
case 3:
167167
host->io_word |= buf[off + 2] << 16;
168168
host->io_pos++;
169+
/* fall through */
169170
case 2:
170171
host->io_word |= buf[off + 1] << 8;
171172
host->io_pos++;
173+
/* fall through */
172174
case 1:
173175
host->io_word |= buf[off];
174176
host->io_pos++;

0 commit comments

Comments
 (0)