Skip to contentSkip to conversation

memstick: mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 5 messages Feb 13, 2019 – Apr 23, 2019

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

PATCH 1/1 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.

---
 drivers/memstick/host/jmb38x_ms.c | 2 ++
 drivers/memstick/host/tifm_ms.c   | 2 ++
 2 files changed, 4 insertions(+)
drivers/memstick/host/jmb38x_ms.c +2 -0
index bcdca9fbef51..49c71f55489f 100644
@@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
 	case 3:
 		host->io_word[0] |= buf[off + 2] << 16;
 		host->io_pos++;
+		/* fall through */
 	case 2:
 		host->io_word[0] |= buf[off + 1] << 8;
 		host->io_pos++;
+		/* fall through */
 	case 1:
 		host->io_word[0] |= buf[off];
 		host->io_pos++;
drivers/memstick/host/tifm_ms.c +2 -0
index bed205849d02..1bbb2ead9556 100644
@@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
 	case 3:
 		host->io_word |= buf[off + 2] << 16;
 		host->io_pos++;
+		/* fall through */
 	case 2:
 		host->io_word |= buf[off + 1] << 8;
 		host->io_pos++;
+		/* fall through */
 	case 1:
 		host->io_word |= buf[off];
 		host->io_pos++;
Signature · 1 line
2.20.1
#1 lore raw

Hi,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

Quoted 76 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/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.

---
 drivers/memstick/host/jmb38x_ms.c | 2 ++
 drivers/memstick/host/tifm_ms.c   | 2 ++
 2 files changed, 4 insertions(+)
drivers/memstick/host/jmb38x_ms.c +2 -0
index bcdca9fbef51..49c71f55489f 100644
@@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
 	case 3:
 		host->io_word[0] |= buf[off + 2] << 16;
 		host->io_pos++;
+		/* fall through */
 	case 2:
 		host->io_word[0] |= buf[off + 1] << 8;
 		host->io_pos++;
+		/* fall through */
 	case 1:
 		host->io_word[0] |= buf[off];
 		host->io_pos++;
drivers/memstick/host/tifm_ms.c +2 -0
index bed205849d02..1bbb2ead9556 100644
@@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
 	case 3:
 		host->io_word |= buf[off + 2] << 16;
 		host->io_pos++;
+		/* fall through */
 	case 2:
 		host->io_word |= buf[off + 1] << 8;
 		host->io_pos++;
+		/* fall through */
 	case 1:
 		host->io_word |= buf[off];
 		host->io_pos++;
#2 lore raw

Hi all,

If no one cares, I'll add this to my tree for 5.2.

Thanks
--
Gustavo

Quoted 87 lines · Gustavo A. R. Silva

Hi,

Friendly ping:

Who can take this?

Thanks
--
Gustavo

Quoted 76 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/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.

---
 drivers/memstick/host/jmb38x_ms.c | 2 ++
 drivers/memstick/host/tifm_ms.c   | 2 ++
 2 files changed, 4 insertions(+)
drivers/memstick/host/jmb38x_ms.c +2 -0
index bcdca9fbef51..49c71f55489f 100644
@@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
 	case 3:
 		host->io_word[0] |= buf[off + 2] << 16;
 		host->io_pos++;
+		/* fall through */
 	case 2:
 		host->io_word[0] |= buf[off + 1] << 8;
 		host->io_pos++;
+		/* fall through */
 	case 1:
 		host->io_word[0] |= buf[off];
 		host->io_pos++;
drivers/memstick/host/tifm_ms.c +2 -0
index bed205849d02..1bbb2ead9556 100644
@@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
 	case 3:
 		host->io_word |= buf[off + 2] << 16;
 		host->io_pos++;
+		/* fall through */
 	case 2:
 		host->io_word |= buf[off + 1] << 8;
 		host->io_pos++;
+		/* fall through */
 	case 1:
 		host->io_word |= buf[off];
 		host->io_pos++;
Reviewed-by on v1 1/1
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 33 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/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:
^~~~

Quoted 6 lines

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

-Kees

Quoted 40 lines
---
 drivers/memstick/host/jmb38x_ms.c | 2 ++
 drivers/memstick/host/tifm_ms.c   | 2 ++
 2 files changed, 4 insertions(+)
drivers/memstick/host/jmb38x_ms.c +2 -0
index bcdca9fbef51..49c71f55489f 100644
@@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
        case 3:
                host->io_word[0] |= buf[off + 2] << 16;
                host->io_pos++;
+               /* fall through */
        case 2:
                host->io_word[0] |= buf[off + 1] << 8;
                host->io_pos++;
+               /* fall through */
        case 1:
                host->io_word[0] |= buf[off];
                host->io_pos++;
drivers/memstick/host/tifm_ms.c +2 -1
index bed205849d02..1bbb2ead9556 100644
@@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
        case 3:
                host->io_word |= buf[off + 2] << 16;
                host->io_pos++;
+               /* fall through */
        case 2:
                host->io_word |= buf[off + 1] << 8;
                host->io_pos++;
+               /* fall through */
        case 1:
                host->io_word |= buf[off];
                host->io_pos++;
--

2.20.1

Signature · 1 line
Kees Cook
#4 lore raw
Quoted 35 lines · Kees Cook
Quoted 33 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/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:
^~~~

Quoted 9 lines
Quoted 6 lines

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

Thanks, Kees!

--
Gustavo