diff mbox series

[net-next] net/mlx5: remove erroneous fallthrough

Message ID 20200803143448.GA346925@mwanda
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series [net-next] net/mlx5: remove erroneous fallthrough | expand

Commit Message

Dan Carpenter Aug. 3, 2020, 2:34 p.m. UTC
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(-)

Comments

Gustavo A. R. Silva Aug. 3, 2020, 3:48 p.m. UTC | #1
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
>
Saeed Mahameed Aug. 19, 2020, 7:29 p.m. UTC | #2
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!
diff mbox series

Patch

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;
 	}