Skip to contentSkip to conversation

netdevsim: fix fall-through annotation

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Apr 29, 2019 – May 1, 2019

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

PATCH 1/1 netdevsim: fix fall-through annotation

Replace "pass through" with a proper "fall through" annotation in order to fix the following warning:

drivers/net/netdevsim/bus.c: In function ‘new_device_store’:
drivers/net/netdevsim/bus.c:170:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
port_count = 1;
~~~~~~~~~~~^~~
drivers/net/netdevsim/bus.c:172:2: note: here
case 2:
^~~~

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

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

---
 drivers/net/netdevsim/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/netdevsim/bus.c +1 -1
index ae482347b67b..fd68eeac574c 100644
@@ -168,7 +168,7 @@ new_device_store(struct bus_type *bus, const char *buf, size_t count)
 	switch (err) {
 	case 1:
 		port_count = 1;
-		/* pass through */
+		/* fall through */
 	case 2:
 		if (id > INT_MAX) {
 			pr_err("Value of \"id\" is too big.\n");
Signature · 1 line
2.21.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Gustavo A. R. Silva

Replace "pass through" with a proper "fall through" annotation in order to fix the following warning:

drivers/net/netdevsim/bus.c: In function ‘new_device_store’:
drivers/net/netdevsim/bus.c:170:14: warning: this statement may fall through [-Wimplicit-fallthrough=]

   port_count = 1;
   ~~~~~~~~~~~^~~

drivers/net/netdevsim/bus.c:172:2: note: here
case 2:
^~~~

Quoted 6 lines

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

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

maintainer Applied
#2 lore raw
In reply to Gustavo A. R. Silva

From: "Gustavo A. R. Silva" <[email protected]>
Date: Mon, 29 Apr 2019 12:38:07 -0500

Quoted 11 lines

Replace "pass through" with a proper "fall through" annotation in order to fix the following warning:

drivers/net/netdevsim/bus.c: In function ‘new_device_store’:
drivers/net/netdevsim/bus.c:170:14: warning: this statement may fall through [-Wimplicit-fallthrough=]

   port_count = 1;
   ~~~~~~~~~~~^~~

drivers/net/netdevsim/bus.c:172:2: note: here
case 2:
^~~~

Quoted 6 lines

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

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

Applied.