net: ethernet: Mark expected switch fall-throughs
Subsystems (25)
cover net: ethernet: Mark expected switch fall-throughs
Hi all,
In preparation to enabling -Wimplicit-fallthrough, this patchset aims to add some annotations in order to mark switch cases where we are expecting to fall through.
Thanks
Gustavo A. R. Silva (33):
8390: axnet_cs: Mark expected switch fall-through
alteon: acenic: mark expected switch fall-through
bnx2x: Mark expected switch fall-thoughs
net: macb: Mark expected switch fall-through
liquidio: mark expected switch fall-through cxgb4/l2t: Mark expected switch fall-through cxgb4/t4_hw: mark expected switch fall-throughs cxgb3/l2t: Mark expected switch fall-through
net: thunderx: mark expected switch fall-through
net: tulip_core: mark expected switch fall-through
net: tulip: de4x5: mark expected switch fall-throughs
be2net: Mark expected switch fall-through
net: hns: Mark expected switch fall-through
net: hns3: Mark expected switch fall-through
i40e_main: mark expected switch fall-through
i40e_txrx: mark expected switch fall-through net/mlx4/mcg: Mark expected switch fall-throughs net/mlx4/en_rx: Mark expected switch fall-throughs
igb_main: Mark expected switch fall-throughs
igb: e1000_82575: Mark expected switch fall-through
igb: e1000_phy: Mark expected switch fall-through
igbvf: netdev: Mark expected switch fall-through
vxge: Mark expected switch fall-throughs net/mlx5e: Mark expected switch fall-throughs
qed: qed_dev: Mark expected switch fall-throughs
netxen_nic: Mark expected switch fall-throughs
qede: qede_fp: Mark expected switch fall-through
qlcnic: Mark expected switch fall-througs
qlge: mark expected switch fall-through
net: ethernet: sxgbe: mark expected switch fall-throughs
net: sfc: falcon: mark expected switch fall-through
net: tlan: Mark expected switch fall-through
net: ethernet: ti: cpts: mark expected switch fall-through
drivers/net/ethernet/8390/axnet_cs.c | 1 + drivers/net/ethernet/alteon/acenic.c | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/cadence/macb_ptp.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c | 1 + drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 1 + drivers/net/ethernet/chelsio/cxgb3/l2t.c | 1 + drivers/net/ethernet/chelsio/cxgb4/l2t.c | 1 + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +++ drivers/net/ethernet/dec/tulip/de4x5.c | 6 ++++++ drivers/net/ethernet/dec/tulip/tulip_core.c | 1 + drivers/net/ethernet/emulex/benet/be_ethtool.c | 1 + drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 1 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++- drivers/net/ethernet/intel/igb/e1000_82575.c | 1 + drivers/net/ethernet/intel/igb/e1000_phy.c | 1 + drivers/net/ethernet/intel/igb/igb_main.c | 2 ++ drivers/net/ethernet/intel/igbvf/netdev.c | 1 + drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++ drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 ++ drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++ drivers/net/ethernet/neterion/vxge/vxge-config.c | 3 +++ drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 3 ++- drivers/net/ethernet/qlogic/qed/qed_dev.c | 4 ++-- drivers/net/ethernet/qlogic/qede/qede_fp.c | 2 ++ drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++- drivers/net/ethernet/qlogic/qlge/qlge_mpi.c | 1 + drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c | 2 ++ drivers/net/ethernet/sfc/falcon/ethtool.c | 1 + drivers/net/ethernet/ti/cpts.c | 1 + drivers/net/ethernet/ti/tlan.c | 1 + 33 files changed, 52 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/33 8390: axnet_cs: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114889 ("Missing break in switch")
--- drivers/net/ethernet/8390/axnet_cs.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/8390/axnet_cs.c +1 -0
@@ -610,6 +610,7 @@ static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)switch (cmd) {case SIOCGMIIPHY : data->phy_id = info->phy_id; +/* Fall through */ case SIOCGMIIREG :/* Read MII PHY register. */ data->val_out =mdio_read (mii_addr, data->phy_id, data->reg_num &0x1f );return 0 ;
Signature · 1 line
2.7.4
PATCH 5/33 liquidio: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 143135 ("Missing break in switch")
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/cavium/liquidio/lio_main.c +1 -0
@@ -2209,6 +2209,7 @@ static int liquidio_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)case SIOCSHWTSTAMP :if (lio->oct_dev->ptp_enable)return hwtstamp_ioctl (netdev, ifr); +/* fall through */ default :return -EOPNOTSUPP ; }
Signature · 1 line
2.7.4
PATCH 7/33 cxgb4/t4_hw: mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114777 ("Missing break in switch")
Addresses-Coverity-ID: 114778 ("Missing break in switch")
Addresses-Coverity-ID: 114779 ("Missing break in switch")
--- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +3 -0
@@ -7504,10 +7504,13 @@ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,switch (nmac) {case 5 :memcpy (mac +24 , c.nmac3,sizeof (c.nmac3)); +/* Fall through */ case 4 :memcpy (mac +18 , c.nmac2,sizeof (c.nmac2)); +/* Fall through */ case 3 :memcpy (mac +12 , c.nmac1,sizeof (c.nmac1)); +/* Fall through */ case 2 :memcpy (mac +6 , c.nmac0,sizeof (c.nmac0)); }
Signature · 1 line
2.7.4
PATCH 6/33 cxgb4/l2t: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114910 ("Missing break in switch")
--- drivers/net/ethernet/chelsio/cxgb4/l2t.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb4/l2t.c +1 -0
@@ -231,6 +231,7 @@ int cxgb4_l2t_send(struct net_device *dev, struct sk_buff *skb,if (e->state ==L2T_STATE_STALE ) e->state =L2T_STATE_VALID ;spin_unlock_bh (&e->lock); +/* fall through */ case L2T_STATE_VALID :/* fast-path, send the packet on */ return t4_ofld_send (adap, skb);case L2T_STATE_RESOLVING :
Signature · 1 line
2.7.4
PATCH 8/33 cxgb3/l2t: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114780 ("Missing break in switch")
--- drivers/net/ethernet/chelsio/cxgb3/l2t.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb3/l2t.c +1 -0
@@ -136,6 +136,7 @@ int t3_l2t_send_slow(struct t3cdev *dev, struct sk_buff *skb,if (e->state ==L2T_STATE_STALE ) e->state =L2T_STATE_VALID ;spin_unlock_bh (&e->lock); +/* fall through */ case L2T_STATE_VALID :/* fast-path, send the packet on */ return cxgb3_ofld_send (dev, skb);case L2T_STATE_RESOLVING :
Signature · 1 line
2.7.4
PATCH 9/33 net: thunderx: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114781 ("Missing break in switch")
--- drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c +1 -0
@@ -527,6 +527,7 @@ static int nicvf_get_rss_hash_opts(struct nicvf *nic,case SCTP_V4_FLOW :case SCTP_V6_FLOW : info->data |=RXH_L4_B_0_1 |RXH_L4_B_2_3 ; +/* Fall through */ case IPV4_FLOW :case IPV6_FLOW : info->data |=RXH_IP_SRC |RXH_IP_DST ;
Signature · 1 line
2.7.4
PATCH 10/33 net: tulip_core: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114782 ("Missing break in switch")
--- drivers/net/ethernet/dec/tulip/tulip_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/dec/tulip/tulip_core.c +1 -0
@@ -923,6 +923,7 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) data->phy_id =1 ; else return -ENODEV; +/* Fall through */ case SIOCGMIIREG :/* Read MII PHY register. */ if (data->phy_id ==32 && (tp->flags &HAS_NWAY )) {
Signature · 1 line
2.7.4
PATCH 11/33 net: tulip: de4x5: mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114784 ("Missing break in switch")
Addresses-Coverity-ID: 114785 ("Missing break in switch")
Addresses-Coverity-ID: 114786 ("Missing break in switch")
--- drivers/net/ethernet/dec/tulip/de4x5.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/dec/tulip/de4x5.c +6 -0
@@ -3204,6 +3204,8 @@ srom_map_media(struct net_device *dev)case SROM_10BASETF :if (!lp->params.fdx)return -1 ; lp->fdx = true; +/* fall through */ +case SROM_10BASET :if (lp->params.fdx && !lp->fdx)return -1 ;if ((lp->chipset ==DC21140 ) || ((lp->chipset & ~0x00ff ) == DC2114x)) {
@@ -3224,6 +3226,8 @@ srom_map_media(struct net_device *dev)case SROM_100BASETF :if (!lp->params.fdx)return -1 ; lp->fdx = true; +/* fall through */ +case SROM_100BASET :if (lp->params.fdx && !lp->fdx)return -1 ; lp->media = _100Mb;
@@ -3236,6 +3240,8 @@ srom_map_media(struct net_device *dev)case SROM_100BASEFF :if (!lp->params.fdx)return -1 ; lp->fdx = true; +/* fall through */ +case SROM_100BASEF :if (lp->params.fdx && !lp->fdx)return -1 ; lp->media = _100Mb;
Signature · 1 line
2.7.4
PATCH 12/33 be2net: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114787 ("Missing break in switch")
--- drivers/net/ethernet/emulex/benet/be_ethtool.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/emulex/benet/be_ethtool.c +1 -0
@@ -575,6 +575,7 @@ static u32 convert_to_et_setting(struct be_adapter *adapter, u32 if_speeds)break ; } } +/* fall through */ case PHY_TYPE_SFP_PLUS_10GB :case PHY_TYPE_XFP_10GB :case PHY_TYPE_SFP_1GB :
Signature · 1 line
2.7.4
PATCH 13/33 net: hns: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114788 ("Missing break in switch")
--- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +1 -0
@@ -307,6 +307,7 @@ static int __lb_setup(struct net_device *ndev,break ;case MAC_LOOP_PHY_NONE : ret =hns_nic_config_phy_loopback (phy_dev,0x0 ); +/* fall through */ case MAC_LOOP_NONE :if (!ret && h->dev->ops->set_loopback) {if (priv->ae_handle->phy_if !=PHY_INTERFACE_MODE_XGMII )
Signature · 1 line
2.7.4
PATCH 14/33 net: hns3: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114789 ("Missing break in switch")
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +1 -0
@@ -2104,6 +2104,7 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb,case HNS3_OL4_TYPE_MAC_IN_UDP :case HNS3_OL4_TYPE_NVGRE : skb->csum_level =1 ; +/* fall through */ case HNS3_OL4_TYPE_NO_TUN :/* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */ if ((l3_type == HNS3_L3_TYPE_IPV4 ||
Signature · 1 line
2.7.4
PATCH 15/33 i40e_main: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114790 ("Missing break in switch")
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
@@ -1800,6 +1800,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, num_tc_qps);break ; } +/* fall through */ case I40E_VSI_FDIR :case I40E_VSI_SRIOV :case I40E_VSI_VMDQ2 :
Signature · 1 line
2.7.4
PATCH 16/33 i40e_txrx: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114791 ("Missing break in switch")
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +2 -1
@@ -2253,9 +2253,10 @@ static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring,break ;default :bpf_warn_invalid_xdp_action (act); +/* fall through */ case XDP_ABORTED :trace_xdp_exception (rx_ring->netdev, xdp_prog, act); -/* fallthrough -- handle aborts by dropping packet */ +/* fall through -- handle aborts by dropping packet */ case XDP_DROP : result =I40E_XDP_CONSUMED ;break ;
Signature · 1 line
2.7.4
PATCH 17/33 net/mlx4/mcg: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114792 ("Missing break in switch")
Addresses-Coverity-ID: 114793 ("Missing break in switch")
--- drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx4/mcg.c +2 -0
@@ -1412,6 +1412,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],case MLX4_STEERING_MODE_A0 :if (prot ==MLX4_PROT_ETH )return 0 ; +/* fall through */ case MLX4_STEERING_MODE_B0 :if (prot ==MLX4_PROT_ETH )
@@ -1441,6 +1442,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],case MLX4_STEERING_MODE_A0 :if (prot ==MLX4_PROT_ETH )return 0 ; +/* fall through */ case MLX4_STEERING_MODE_B0 :if (prot ==MLX4_PROT_ETH )
Signature · 1 line
2.7.4
PATCH 18/33 net/mlx4/en_rx: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114794 ("Missing break in switch")
Addresses-Coverity-ID: 114795 ("Missing break in switch")
--- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx4/en_rx.c +2 -0
@@ -795,8 +795,10 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud goto xdp_drop_no_cnt;/* Drop on xmit failure */ default :bpf_warn_invalid_xdp_action (act); +/* fall through */ case XDP_ABORTED :trace_xdp_exception (dev, xdp_prog, act); +/* fall through */ case XDP_DROP : ring->xdp_drop++; xdp_drop_no_cnt:
Signature · 1 line
2.7.4
PATCH 19/33 igb_main: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 200521 ("Missing break in switch")
Addresses-Coverity-ID: 114797 ("Missing break in switch")
--- drivers/net/ethernet/intel/igb/igb_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/igb/igb_main.c +2 -0
@@ -5175,6 +5175,7 @@ bool igb_has_link(struct igb_adapter *adapter)case e1000_media_type_copper:if (!hw->mac.get_link_status)return true; +/* fall through */ case e1000_media_type_internal_serdes: hw->mac.ops.check_for_link (hw); link_active = !hw->mac.get_link_status;
@@ -5835,6 +5836,7 @@ static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first) type_tucmd =E1000_ADVTXD_TUCMD_L4T_SCTP ;break ; } +/* fall through */ default :skb_checksum_help (skb); goto csum_failed;
Signature · 1 line
2.7.4
PATCH 20/33 igb: e1000_82575: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114799 ("Missing break in switch")
--- drivers/net/ethernet/intel/igb/e1000_82575.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/igb/e1000_82575.c +1 -0
@@ -1708,6 +1708,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX :/* disable PCS autoneg and support parallel detect only */ pcs_autoneg = false; +/* fall through */ default :if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) {
Signature · 1 line
2.7.4
PATCH 21/33 igb: e1000_phy: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114800 ("Missing break in switch")
--- drivers/net/ethernet/intel/igb/e1000_phy.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/igb/e1000_phy.c +1 -0
@@ -659,6 +659,7 @@ s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw) phy_data |=M88E1000_PSCR_AUTO_X_1000T ;break ; } +/* fall through */ case 0 :default : phy_data |=M88E1000_PSCR_AUTO_X_MODE ;
Signature · 1 line
2.7.4
PATCH 22/33 igbvf: netdev: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114801 ("Missing break in switch")
--- drivers/net/ethernet/intel/igbvf/netdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/igbvf/netdev.c +1 -0
@@ -2102,6 +2102,7 @@ static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb, type_tucmd =E1000_ADVTXD_TUCMD_L4T_SCTP ;break ; } +/* fall through */ default :skb_checksum_help (skb); goto csum_failed;
Signature · 1 line
2.7.4
PATCH 23/33 vxge: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114796 ("Missing break in switch")
Addresses-Coverity-ID: 114804 ("Missing break in switch")
Addresses-Coverity-ID: 114806 ("Missing break in switch")
--- drivers/net/ethernet/neterion/vxge/vxge-config.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/neterion/vxge/vxge-config.c +3 -0
@@ -3783,17 +3783,20 @@ vxge_hw_rts_rth_data0_data1_get(u32 j, u64 *data0, u64 *data1,VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_ENTRY_EN |VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_BUCKET_DATA ( itable[j]); +/* fall through */ case 2 : *data0 |=VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM1_BUCKET_NUM (j)|VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM1_ENTRY_EN |VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM1_BUCKET_DATA ( itable[j]); +/* fall through */ case 3 : *data1 =VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM0_BUCKET_NUM (j)|VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM0_ENTRY_EN |VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM0_BUCKET_DATA ( itable[j]); +/* fall through */ case 4 : *data1 |= VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM1_BUCKET_NUM(j)|
Signature · 1 line
2.7.4
PATCH 24/33 net/mlx5e: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114808 ("Missing break in switch")
Addresses-Coverity-ID: 114802 ("Missing break in switch")
--- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +2 -0
@@ -91,9 +91,11 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,return true;default :bpf_warn_invalid_xdp_action (act); +/* fall through */ case XDP_ABORTED : xdp_abort:trace_xdp_exception (rq->netdev, prog, act); +/* fall through */ case XDP_DROP : rq->stats->xdp_drop++;return true;
Signature · 1 line
2.7.4
PATCH 25/33 qed: qed_dev: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Notice that in this particular case, I replaced the code comments with a proper "fall through" annotation, which is what GCC is expecting to find.
Addresses-Coverity-ID: 114809 ("Missing break in switch")
Addresses-Coverity-ID: 114810 ("Missing break in switch")
--- drivers/net/ethernet/qlogic/qed/qed_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_dev.c +2 -2
@@ -1709,14 +1709,14 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) p_hwfn->hw_info.hw_mode);if (rc)break ; -/* Fall into */ +/* Fall through */ case FW_MSG_CODE_DRV_LOAD_PORT : rc =qed_hw_init_port (p_hwfn, p_hwfn->p_main_ptt, p_hwfn->hw_info.hw_mode);if (rc)break ; -/* Fall into */ +/* Fall through */ case FW_MSG_CODE_DRV_LOAD_FUNCTION : rc = qed_hw_init_pf(p_hwfn, p_hwfn->p_main_ptt, p_params->p_tunn,
Signature · 1 line
2.7.4
PATCH 26/33 netxen_nic: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 1410182 ("Missing break in switch")
Addresses-Coverity-ID: 1410183 ("Missing break in switch")
--- drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c +2 -1
@@ -167,9 +167,9 @@ netxen_nic_get_link_ksettings(struct net_device *dev,case NETXEN_BRDTYPE_P3_REF_QG :case NETXEN_BRDTYPE_P3_4_GB :case NETXEN_BRDTYPE_P3_4_GB_MM : - supported |= SUPPORTED_Autoneg; advertising |= ADVERTISED_Autoneg; +/* fall through */ case NETXEN_BRDTYPE_P2_SB31_10G_CX4 :case NETXEN_BRDTYPE_P3_10G_CX4 :case NETXEN_BRDTYPE_P3_10G_CX4_LP :
@@ -198,6 +198,7 @@ netxen_nic_get_link_ksettings(struct net_device *dev, supported |=SUPPORTED_TP ; check_sfp_module =netif_running (dev) && adapter->has_link_events; +/* fall through */ case NETXEN_BRDTYPE_P2_SB31_10G :case NETXEN_BRDTYPE_P3_10G_XFP : supported |=SUPPORTED_FIBRE ;
Signature · 1 line
2.7.4
PATCH 27/33 qede: qede_fp: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 1384501 ("Missing break in switch")
Addresses-Coverity-ID: 1398869 ("Missing break in switch")
--- drivers/net/ethernet/qlogic/qede/qede_fp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qede/qede_fp.c +2 -0
@@ -1119,8 +1119,10 @@ static bool qede_rx_xdp(struct qede_dev *edev,default :bpf_warn_invalid_xdp_action (act); +/* Fall through */ case XDP_ABORTED :trace_xdp_exception (edev->ndev, prog, act); +/* Fall through */ case XDP_DROP :qede_recycle_rx_bd_ring (rxq, cqe->bd_num); }
Signature · 1 line
2.7.4
PATCH 28/33 qlcnic: Mark expected switch fall-througs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 1410181 ("Missing break in switch")
Addresses-Coverity-ID: 1410184 ("Missing break in switch")
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +2 -1
@@ -351,9 +351,9 @@ static int qlcnic_82xx_get_link_ksettings(struct qlcnic_adapter *adapter,case QLCNIC_BRDTYPE_P3P_REF_QG :case QLCNIC_BRDTYPE_P3P_4_GB :case QLCNIC_BRDTYPE_P3P_4_GB_MM : - supported |= SUPPORTED_Autoneg; advertising |= ADVERTISED_Autoneg; +/* fall through */ case QLCNIC_BRDTYPE_P3P_10G_CX4 :case QLCNIC_BRDTYPE_P3P_10G_CX4_LP :case QLCNIC_BRDTYPE_P3P_10000_BASE_T :
@@ -377,6 +377,7 @@ static int qlcnic_82xx_get_link_ksettings(struct qlcnic_adapter *adapter, supported |=SUPPORTED_TP ; check_sfp_module =netif_running (adapter->netdev) && ahw->has_link_events; +/* fall through */ case QLCNIC_BRDTYPE_P3P_10G_XFP : supported |=SUPPORTED_FIBRE ; advertising |=ADVERTISED_FIBRE ;
Signature · 1 line
2.7.4
PATCH 29/33 qlge: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114811 ("Missing break in switch")
--- drivers/net/ethernet/qlogic/qlge/qlge_mpi.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/qlogic/qlge/qlge_mpi.c +1 -0
@@ -1176,6 +1176,7 @@ void ql_mpi_idc_work(struct work_struct *work)case MB_CMD_PORT_RESET :case MB_CMD_STOP_FW :ql_link_off (qdev); +/* Fall through */ case MB_CMD_SET_PORT_CFG :/* Signal the resulting link up AEN * that the frame routing and mac addr
Signature · 1 line
2.7.4
PATCH 30/33 net: ethernet: sxgbe: mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 1357414 ("Missing break in switch")
Addresses-Coverity-ID: 1357415 ("Missing break in switch")
--- drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c +2 -0
@@ -319,6 +319,7 @@ static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,case TCP_V4_FLOW :case UDP_V4_FLOW : cmd->data |=RXH_L4_B_0_1 |RXH_L4_B_2_3 ; +/* Fall through */ case SCTP_V4_FLOW :case AH_ESP_V4_FLOW :case AH_V4_FLOW :
@@ -329,6 +330,7 @@ static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,case TCP_V6_FLOW :case UDP_V6_FLOW : cmd->data |=RXH_L4_B_0_1 |RXH_L4_B_2_3 ; +/* Fall through */ case SCTP_V6_FLOW :case AH_ESP_V6_FLOW :case AH_V6_FLOW :
Signature · 1 line
2.7.4
PATCH 2/33 alteon: acenic: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114891 ("Missing break in switch")
--- drivers/net/ethernet/alteon/acenic.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/alteon/acenic.c +1 -0
@@ -551,6 +551,7 @@ static int acenic_probe_one(struct pci_dev *pdev, ap->name);break ; } +/* Fall through */ case PCI_VENDOR_ID_SGI :printk (KERN_INFO "%s: SGI AceNIC " , ap->name);break ;
Signature · 1 line
2.7.4
PATCH 31/33 net: sfc: falcon: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 1384500 ("Missing break in switch")
--- drivers/net/ethernet/sfc/falcon/ethtool.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/sfc/falcon/ethtool.c +1 -0
@@ -963,6 +963,7 @@ ef4_ethtool_get_rxnfc(struct net_device *net_dev,switch (info->flow_type) {case TCP_V4_FLOW : info->data |=RXH_L4_B_0_1 |RXH_L4_B_2_3 ; +/* Fall through */ case UDP_V4_FLOW :case SCTP_V4_FLOW :case AH_ESP_V4_FLOW :
Signature · 1 line
2.7.4
PATCH 32/33 net: tlan: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 141440 ("Missing break in switch")
--- drivers/net/ethernet/ti/tlan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/ti/tlan.c +1 -0
@@ -966,6 +966,7 @@ static int tlan_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)switch (cmd) {case SIOCGMIIPHY :/* get address of MII PHY in use. */ data->phy_id = phy; +/* fall through */ case SIOCGMIIREG :/* read MII PHY register. */
Signature · 1 line
2.7.4
PATCH 33/33 net: ethernet: ti: cpts: mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114813 ("Missing break in switch")
--- drivers/net/ethernet/ti/cpts.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/ti/cpts.c +1 -0
@@ -161,6 +161,7 @@ static int cpts_fifo_read(struct cpts *cpts, int match)*/ break ; } +/* fall through */ case CPTS_EV_PUSH :case CPTS_EV_RX :list_del_init (&event->list);
Signature · 1 line
2.7.4
PATCH 3/33 bnx2x: Mark expected switch fall-thoughs
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114878 ("Missing break in switch")
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -1729,8 +1729,8 @@ static int bnxt_async_event_process(struct bnxt *bp, speed); }set_bit (BNXT_LINK_SPEED_CHNG_SP_EVENT , &bp->sp_event); -/* fall through */ } +/* fall through */ case ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE :set_bit (BNXT_LINK_CHNG_SP_EVENT , &bp->sp_event);break ;
Signature · 1 line
2.7.4
PATCH 4/33 net: macb: Mark expected switch fall-through
In reply to Gustavo A. R. SilvaIn preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
--- drivers/net/ethernet/cadence/macb_ptp.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/cadence/macb_ptp.c +1 -0
@@ -466,6 +466,7 @@ int gem_set_hwtst(struct net_device *dev, struct ifreq *ifr, int cmd)case HWTSTAMP_TX_ONESTEP_SYNC :if (gem_ptp_set_one_step_sync (bp,1 ) !=0 )return -ERANGE ; +/* fall through */ case HWTSTAMP_TX_ON : tx_bd_control =TSTAMP_ALL_FRAMES ;break ;
Signature · 1 line
2.7.4
David Miller
maintainerFrom: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 7 Aug 2018 18:09:00 -0500
Quoted 3 lines
In preparation to enabling -Wimplicit-fallthrough, this patchset aims to add some annotations in order to mark switch cases where we are expecting to fall through.
Ok, I went through all of these and they look good.
If any are not correct we can revert/fix.
Series applied, thanks.
Quoted 11 lines · David Miller
From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 7 Aug 2018 18:09:00 -0500Quoted 3 lines
In preparation to enabling -Wimplicit-fallthrough, this patchset aims to add some annotations in order to mark switch cases where we are expecting to fall through.
Ok, I went through all of these and they look good.
If any are not correct we can revert/fix.
Yep. If anything is reported, I'll take a look right away.
Quoted 2 lines
Series applied, thanks.
Thanks
--
Gustavo
Re: [PATCH 24/33] net/mlx5e: Mark expected switch fall-throughs
In reply to Gustavo A. R. SilvaQuoted 6 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
Addresses-Coverity-ID: 114808 ("Missing break in switch")
Addresses-Coverity-ID: 114802 ("Missing break in switch")Signed-off-by Gustavo A. R. Silva <[email protected]>
Quoted 23 lines
--- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +2
-1@@ -91,9 +91,11 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,return true;default :bpf_warn_invalid_xdp_action (act); +/* fall through */ case XDP_ABORTED : xdp_abort:trace_xdp_exception (rq->netdev, prog, act); +/* fall through */ case XDP_DROP : rq->stats->xdp_drop++;return true; --2.7.4