Skip to contentSkip to conversation

phylink: mark expected switch fall-throughs in phylink_mii_ioctl

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Jan 5, 2018 – Jan 8, 2018

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

PATCH 1/1 phylink: mark expected switch fall-throughs in phylink_mii_ioctl

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1463447 ("Missing break in switch")

---
This code was compiled with GCC 7.2.0

 drivers/net/phy/phylink.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/phy/phylink.c +2 -0
index 4e8c459..6ac8b29 100644
@@ -1525,6 +1525,7 @@ int phylink_mii_ioctl(struct phylink *pl, struct ifreq *ifr, int cmd)
 		switch (cmd) {
 		case SIOCGMIIPHY:
 			mii->phy_id = pl->phydev->mdio.addr;
+			/* fall through */
 
 		case SIOCGMIIREG:
 			ret = phylink_phy_read(pl, mii->phy_id, mii->reg_num);
@@ -1547,6 +1548,7 @@ int phylink_mii_ioctl(struct phylink *pl, struct ifreq *ifr, int cmd)
 		switch (cmd) {
 		case SIOCGMIIPHY:
 			mii->phy_id = 0;
+			/* fall through */
 
 		case SIOCGMIIREG:
 			ret = phylink_mii_read(pl, mii->phy_id, mii->reg_num);
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

From: "Gustavo A. R. Silva" <[email protected]>
Date: Fri, 5 Jan 2018 11:23:45 -0600

Quoted 5 lines

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1463447 ("Missing break in switch")

Applied.