diff mbox series

[net-next] net/mlx5: Fix error code in mlx5_is_reset_now_capable()

Message ID 53f95829-1a94-4565-aa75-f0335cd64b8a@moroto.mountain (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/mlx5: Fix error code in mlx5_is_reset_now_capable() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter June 20, 2023, 1:43 p.m. UTC
The mlx5_is_reset_now_capable() function returns bool, not negative
error codes.  So if fast teardown is not supported it should return
false instead of -EOPNOTSUPP.

Fixes: 92501fa6e421 ("net/mlx5: Ack on sync_reset_request only if PF can do reset_now")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalesh AP June 20, 2023, 2:29 p.m. UTC | #1
On Tue, Jun 20, 2023 at 7:13 PM Dan Carpenter <dan.carpenter@linaro.org>
wrote:

> The mlx5_is_reset_now_capable() function returns bool, not negative
> error codes.  So if fast teardown is not supported it should return
> false instead of -EOPNOTSUPP.
>
> Fixes: 92501fa6e421 ("net/mlx5: Ack on sync_reset_request only if PF can
> do reset_now")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

> ---
>  drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
> b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
> index 7af2b14ab5d8..fb7874da3caa 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
> @@ -327,7 +327,7 @@ static bool mlx5_is_reset_now_capable(struct
> mlx5_core_dev *dev)
>
>         if (!MLX5_CAP_GEN(dev, fast_teardown)) {
>                 mlx5_core_warn(dev, "fast teardown is not supported by
> firmware\n");
> -               return -EOPNOTSUPP;
> +               return false;
>         }
>
>         err = pci_read_config_word(dev->pdev, PCI_DEVICE_ID, &dev_id);
> --
> 2.39.2
>
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
index 7af2b14ab5d8..fb7874da3caa 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
@@ -327,7 +327,7 @@  static bool mlx5_is_reset_now_capable(struct mlx5_core_dev *dev)
 
 	if (!MLX5_CAP_GEN(dev, fast_teardown)) {
 		mlx5_core_warn(dev, "fast teardown is not supported by firmware\n");
-		return -EOPNOTSUPP;
+		return false;
 	}
 
 	err = pci_read_config_word(dev->pdev, PCI_DEVICE_ID, &dev_id);