Skip to contentSkip to conversation

net: spider_net: Mark expected switch fall-through

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

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

PATCH 1/1 net: spider_net: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/ethernet/toshiba/spider_net.c: In function 'spider_net_release_tx_chain':
drivers/net/ethernet/toshiba/spider_net.c:783:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (!brutal) {
       ^

drivers/net/ethernet/toshiba/spider_net.c:792:3: note: here
case SPIDER_NET_DESCR_RESPONSE_ERROR:
^~~~

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

---
 drivers/net/ethernet/toshiba/spider_net.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/toshiba/spider_net.c +1 -0
index 5b196ebfed49..0f346761a2b2 100644
@@ -788,6 +788,7 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
 			/* fallthrough, if we release the descriptors
 			 * brutally (then we don't care about
 			 * SPIDER_NET_DESCR_CARDOWNED) */
+			/* Fall through */
 
 		case SPIDER_NET_DESCR_RESPONSE_ERROR:
 		case SPIDER_NET_DESCR_PROTECTION_ERROR:
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/ethernet/toshiba/spider_net.c: In function 'spider_net_release_tx_chain':
drivers/net/ethernet/toshiba/spider_net.c:783:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (!brutal) {
       ^
drivers/net/ethernet/toshiba/spider_net.c:792:3: note: here
   case SPIDER_NET_DESCR_RESPONSE_ERROR:
   ^~~~
Quoted 5 lines

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

-Kees

Quoted 19 lines
---
 drivers/net/ethernet/toshiba/spider_net.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/toshiba/spider_net.c +1 -0
index 5b196ebfed49..0f346761a2b2 100644
@@ -788,6 +788,7 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
 			/* fallthrough, if we release the descriptors
 			 * brutally (then we don't care about
 			 * SPIDER_NET_DESCR_CARDOWNED) */
+			/* Fall through */
 
 		case SPIDER_NET_DESCR_RESPONSE_ERROR:
 		case SPIDER_NET_DESCR_PROTECTION_ERROR:
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
maintainer Applied
#2 lore raw
In reply to Gustavo A. R. Silva

From: "Gustavo A. R. Silva" <[email protected]>
Date: Sun, 28 Jul 2019 19:32:51 -0500

Quoted 12 lines

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/ethernet/toshiba/spider_net.c: In function 'spider_net_release_tx_chain':
drivers/net/ethernet/toshiba/spider_net.c:783:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (!brutal) {
       ^
drivers/net/ethernet/toshiba/spider_net.c:792:3: note: here
   case SPIDER_NET_DESCR_RESPONSE_ERROR:
   ^~~~
Quoted 5 lines

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

Applied.