Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5: remove erroneous fallthrough
@ 2020-08-03 14:34 Dan Carpenter
  2020-08-03 15:48 ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-08-03 14:34 UTC (permalink / raw)
  To: Saeed Mahameed, Gustavo A. R. Silva
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, netdev,
	linux-rdma, kernel-janitors

This isn't a fall through because it was after a return statement.  The
fall through annotation leads to a Smatch warning:

    drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:246
    mlx5e_ethtool_get_sset_count() warn: ignoring unreachable code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 08270987c506..48397a577fcd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -243,7 +243,6 @@ int mlx5e_ethtool_get_sset_count(struct mlx5e_priv *priv, int sset)
 		return MLX5E_NUM_PFLAGS;
 	case ETH_SS_TEST:
 		return mlx5e_self_test_num(priv);
-		fallthrough;
 	default:
 		return -EOPNOTSUPP;
 	}
-- 
2.27.0


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

* Re: [PATCH net-next] net/mlx5: remove erroneous fallthrough
  2020-08-03 14:34 [PATCH net-next] net/mlx5: remove erroneous fallthrough Dan Carpenter
@ 2020-08-03 15:48 ` Gustavo A. R. Silva
  2020-08-19 19:29   ` Saeed Mahameed
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2020-08-03 15:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Saeed Mahameed, Leon Romanovsky, David S. Miller, Jakub Kicinski,
	netdev, linux-rdma, kernel-janitors

On Mon, Aug 03, 2020 at 05:34:48PM +0300, Dan Carpenter wrote:
> This isn't a fall through because it was after a return statement.  The
> fall through annotation leads to a Smatch warning:
> 
>     drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:246
>     mlx5e_ethtool_get_sset_count() warn: ignoring unreachable code.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks
--
Gustavo

> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> index 08270987c506..48397a577fcd 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> @@ -243,7 +243,6 @@ int mlx5e_ethtool_get_sset_count(struct mlx5e_priv *priv, int sset)
>  		return MLX5E_NUM_PFLAGS;
>  	case ETH_SS_TEST:
>  		return mlx5e_self_test_num(priv);
> -		fallthrough;
>  	default:
>  		return -EOPNOTSUPP;
>  	}
> -- 
> 2.27.0
> 

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

* Re: [PATCH net-next] net/mlx5: remove erroneous fallthrough
  2020-08-03 15:48 ` Gustavo A. R. Silva
@ 2020-08-19 19:29   ` Saeed Mahameed
  0 siblings, 0 replies; 3+ messages in thread
From: Saeed Mahameed @ 2020-08-19 19:29 UTC (permalink / raw)
  To: dan.carpenter, gustavoars
  Cc: linux-rdma, kernel-janitors, davem, kuba, leon, netdev

On Mon, 2020-08-03 at 10:48 -0500, Gustavo A. R. Silva wrote:
> On Mon, Aug 03, 2020 at 05:34:48PM +0300, Dan Carpenter wrote:
> > This isn't a fall through because it was after a return
> > statement.  The
> > fall through annotation leads to a Smatch warning:
> > 
> >     drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:246
> >     mlx5e_ethtool_get_sset_count() warn: ignoring unreachable code.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 

Applied to net-next-mlx5

Thanks!

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

end of thread, other threads:[~2020-08-19 19:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 14:34 [PATCH net-next] net/mlx5: remove erroneous fallthrough Dan Carpenter
2020-08-03 15:48 ` Gustavo A. R. Silva
2020-08-19 19:29   ` Saeed Mahameed

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