linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs
@ 2018-08-07 23:09 Gustavo A. R. Silva
  2018-08-07 23:21 ` [PATCH 17/33] net/mlx4/mcg: " Gustavo A. R. Silva
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-07 23:09 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Solarflare linux maintainers, Edward Cree, Bert Kenward,
	Jes Sorensen, linux-acenic, Michael Chan, Nicolas Ferre,
	Derek Chickles, Satanand Burla, Felix Manlunas, Raghu Vatsavayi,
	Ganesh Goudar, Santosh Raspatur, Sunil Goutham, Robert Richter,
	linux-arm-kernel, linux-parisc, Sathya Perla, Ajit

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(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 17/33] net/mlx4/mcg: Mark expected switch fall-throughs
  2018-08-07 23:09 [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-08-07 23:21 ` Gustavo A. R. Silva
  2018-08-07 23:21 ` [PATCH 18/33] net/mlx4/en_rx: " Gustavo A. R. Silva
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-07 23:21 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Tariq Toukan, linux-rdma

In 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 4c5306d..ffed2d4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 18/33] net/mlx4/en_rx: Mark expected switch fall-throughs
  2018-08-07 23:09 [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs Gustavo A. R. Silva
  2018-08-07 23:21 ` [PATCH 17/33] net/mlx4/mcg: " Gustavo A. R. Silva
@ 2018-08-07 23:21 ` Gustavo A. R. Silva
  2018-08-07 23:25 ` [PATCH 24/33] net/mlx5e: " Gustavo A. R. Silva
  2018-08-08  0:59 ` [PATCH 00/33] net: ethernet: " David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-07 23:21 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Tariq Toukan, linux-rdma

In 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 3360f7b..a1aeeb8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -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:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 24/33] net/mlx5e: Mark expected switch fall-throughs
  2018-08-07 23:09 [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs Gustavo A. R. Silva
  2018-08-07 23:21 ` [PATCH 17/33] net/mlx4/mcg: " Gustavo A. R. Silva
  2018-08-07 23:21 ` [PATCH 18/33] net/mlx4/en_rx: " Gustavo A. R. Silva
@ 2018-08-07 23:25 ` Gustavo A. R. Silva
  2018-08-08 22:26   ` Saeed Mahameed
  2018-08-08  0:59 ` [PATCH 00/33] net: ethernet: " David Miller
  3 siblings, 1 reply; 7+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-07 23:25 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Saeed Mahameed, Leon Romanovsky, linux-rdma

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 <gustavo@embeddedor.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
index 1881468..ad6d471 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
@@ -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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs
  2018-08-07 23:09 [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (2 preceding siblings ...)
  2018-08-07 23:25 ` [PATCH 24/33] net/mlx5e: " Gustavo A. R. Silva
@ 2018-08-08  0:59 ` David Miller
  2018-08-08 16:26   ` Gustavo A. R. Silva
  3 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2018-08-08  0:59 UTC (permalink / raw)
  To: gustavo
  Cc: netdev, linux-kernel, linux-net-drivers, ecree, bkenward, jes,
	linux-acenic, michael.chan, nicolas.ferre, derek.chickles,
	satananda.burla, felix.manlunas, raghu.vatsavayi, ganeshgr,
	santosh, sgoutham, rric, linux-arm-kernel, linux-parisc,
	sathya.perla, ajit.khaparde, sriharsha.basavapatna,
	somnath.kotur, yisen.zhuang, salil.mehta, jeffrey.t.kirsher,
	intel-wired-lan, tariqt

From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Tue, 7 Aug 2018 18:09:00 -0500

> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs
  2018-08-08  0:59 ` [PATCH 00/33] net: ethernet: " David Miller
@ 2018-08-08 16:26   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 7+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-08 16:26 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-kernel, linux-net-drivers, ecree, bkenward, jes,
	linux-acenic, michael.chan, nicolas.ferre, derek.chickles,
	satananda.burla, felix.manlunas, raghu.vatsavayi, ganeshgr,
	santosh, sgoutham, rric, linux-arm-kernel, linux-parisc,
	sathya.perla, ajit.khaparde, sriharsha.basavapatna,
	somnath.kotur, yisen.zhuang, salil.mehta, jeffrey.t.kirsher,
	intel-wired-lan, tariqt



On 8/7/18 7:59 PM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Date: Tue, 7 Aug 2018 18:09:00 -0500
> 
>> 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.

> Series applied, thanks.
> 

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 24/33] net/mlx5e: Mark expected switch fall-throughs
  2018-08-07 23:25 ` [PATCH 24/33] net/mlx5e: " Gustavo A. R. Silva
@ 2018-08-08 22:26   ` Saeed Mahameed
  0 siblings, 0 replies; 7+ messages in thread
From: Saeed Mahameed @ 2018-08-08 22:26 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: David S. Miller, Linux Netdev List, linux-kernel, Saeed Mahameed,
	Leon Romanovsky, RDMA mailing list

On Tue, Aug 7, 2018 at 4:25 PM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> 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 <gustavo@embeddedor.com>

Acked-by: Saeed Mahameed <saeedm@mellanox.com>

> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> index 1881468..ad6d471 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-08 22:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07 23:09 [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-08-07 23:21 ` [PATCH 17/33] net/mlx4/mcg: " Gustavo A. R. Silva
2018-08-07 23:21 ` [PATCH 18/33] net/mlx4/en_rx: " Gustavo A. R. Silva
2018-08-07 23:25 ` [PATCH 24/33] net/mlx5e: " Gustavo A. R. Silva
2018-08-08 22:26   ` Saeed Mahameed
2018-08-08  0:59 ` [PATCH 00/33] net: ethernet: " David Miller
2018-08-08 16:26   ` Gustavo A. R. Silva

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).