* [PATCH net-next] net: dsa: microchip: mark expected switch fall-through
@ 2019-04-01 20:34 Gustavo A. R. Silva
2019-04-04 4:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-01 20:34 UTC (permalink / raw)
To: Woojung Huh, Microchip Linux Driver Support, Andrew Lunn,
Vivien Didelot, Florian Fainelli, David S. Miller, Tristram Ha
Cc: netdev, linux-kernel, Gustavo A. R. Silva, Kees Cook
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/dsa/microchip/ksz9477.c: In function ‘ksz9477_get_interface’:
drivers/net/dsa/microchip/ksz9477.c:1145:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (gbit)
^
drivers/net/dsa/microchip/ksz9477.c:1147:2: note: here
case 0:
^~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/dsa/microchip/ksz9477.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index f16e1d7d8615..c026d15721f6 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -1144,6 +1144,7 @@ static phy_interface_t ksz9477_get_interface(struct ksz_device *dev, int port)
interface = PHY_INTERFACE_MODE_GMII;
if (gbit)
break;
+ /* fall through */
case 0:
interface = PHY_INTERFACE_MODE_MII;
break;
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: dsa: microchip: mark expected switch fall-through
2019-04-01 20:34 [PATCH net-next] net: dsa: microchip: mark expected switch fall-through Gustavo A. R. Silva
@ 2019-04-04 4:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-04-04 4:39 UTC (permalink / raw)
To: gustavo
Cc: Woojung.Huh, UNGLinuxDriver, andrew, vivien.didelot, f.fainelli,
Tristram.Ha, netdev, linux-kernel, keescook
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 1 Apr 2019 15:34:49 -0500
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> drivers/net/dsa/microchip/ksz9477.c: In function ‘ksz9477_get_interface’:
> drivers/net/dsa/microchip/ksz9477.c:1145:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (gbit)
> ^
> drivers/net/dsa/microchip/ksz9477.c:1147:2: note: here
> case 0:
> ^~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-04 4:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 20:34 [PATCH net-next] net: dsa: microchip: mark expected switch fall-through Gustavo A. R. Silva
2019-04-04 4:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).