Skip to contentSkip to conversation

net: usb: Mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Jun 28, 2018 – Jun 30, 2018

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

PATCH 1/1 net: usb: Mark expected switch fall-throughs

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

---
 drivers/net/usb/catc.c       | 1 +
 drivers/net/usb/cdc-phonet.c | 1 +
 drivers/net/usb/r8152.c      | 2 ++
 3 files changed, 4 insertions(+)
drivers/net/usb/catc.c +1 -0
index 18d36df..424053b 100644
@@ -869,6 +869,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
 		default:
 			dev_warn(&intf->dev,
 				 "Couldn't detect memory size, assuming 32k\n");
+			/* fall through */
 		case 0x87654321:
 			catc_set_reg(catc, TxBufCount, 4);
 			catc_set_reg(catc, RxBufCount, 16);
drivers/net/usb/cdc-phonet.c +1 -0
index 3c40312..78b16eb 100644
@@ -110,6 +110,7 @@ static void tx_complete(struct urb *req)
 	case -ECONNRESET:
 	case -ESHUTDOWN:
 		dev->stats.tx_aborted_errors++;
+		/* fall through */
 	default:
 		dev->stats.tx_errors++;
 		dev_dbg(&dev->dev, "TX error (%d)\n", status);
drivers/net/usb/r8152.c +2 -0
index 1fd1650..124211a 100644
@@ -1376,6 +1376,7 @@ static void intr_callback(struct urb *urb)
 	case -ECONNRESET:	/* unlink */
 	case -ESHUTDOWN:
 		netif_device_detach(tp->netdev);
+		/* fall through */
 	case -ENOENT:
 	case -EPROTO:
 		netif_info(tp, intr, tp->netdev,
@@ -2741,6 +2742,7 @@ static void r8153b_ups_en(struct r8152 *tp, bool enable)
 			r8152_mdio_write(tp, MII_BMCR, data);
 
 			data = r8153_phy_status(tp, PHY_STAT_LAN_ON);
+			/* fall through */
 
 		default:
 			if (data != PHY_STAT_LAN_ON)
maintainer
#1 lore raw

From: "Gustavo A. R. Silva" <[email protected]>
Date: Thu, 28 Jun 2018 13:50:48 -0500

Quoted 4 lines

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

Applied.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html