diff mbox series

net/mlx5e: Fix error code in mlx5e_fec_in_caps()

Message ID 20200224065557.d23b4yd46kjnzfya@kili.mountain (mailing list archive)
State Not Applicable
Headers show
Series net/mlx5e: Fix error code in mlx5e_fec_in_caps() | expand

Commit Message

Dan Carpenter Feb. 24, 2020, 6:55 a.m. UTC
The mlx5e_fec_in_caps() function is type bool so these negative returns
become "return true;" when they should be "return false;"

Fixes: 2132b71f78d2 ("net/mlx5e: Advertise globaly supported FEC modes")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky Feb. 24, 2020, 10:52 a.m. UTC | #1
On Mon, Feb 24, 2020 at 09:55:57AM +0300, Dan Carpenter wrote:
> The mlx5e_fec_in_caps() function is type bool so these negative returns
> become "return true;" when they should be "return false;"
>
> Fixes: 2132b71f78d2 ("net/mlx5e: Advertise globaly supported FEC modes")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/port.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
index 2c4a670c8ffd..b5ddf9bf2681 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
@@ -471,10 +471,10 @@  bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
 	int i;
 
 	if (!MLX5_CAP_GEN(dev, pcam_reg))
-		return -EOPNOTSUPP;
+		return false;
 
 	if (!MLX5_CAP_PCAM_REG(dev, pplm))
-		return -EOPNOTSUPP;
+		return false;
 
 	MLX5_SET(pplm_reg, in, local_port, 1);
 	err =  mlx5_core_access_reg(dev, in, sz, out, sz, MLX5_REG_PPLM, 0, 0);