diff mbox series

net: ethernet: mellanox: return errno instead of 1

Message ID 1640226277-32786-1-git-send-email-wangqing@vivo.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series net: ethernet: mellanox: return errno instead of 1 | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 3 maintainers not CCed: moshe@nvidia.com ayal@nvidia.com tariqt@nvidia.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
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
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

王擎 Dec. 23, 2021, 2:24 a.m. UTC
From: Wang Qing <wangqing@vivo.com>

mlx5e_hv_vhca_stats_create() better return specific error than 1

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Saeed Mahameed Dec. 23, 2021, 7:34 p.m. UTC | #1
On Wed, 2021-12-22 at 18:24 -0800, Qing Wang wrote:
> From: Wang Qing <wangqing@vivo.com>
> 
> mlx5e_hv_vhca_stats_create() better return specific error than 1
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> index d290d72..04cda3d
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> @@ -142,7 +142,7 @@ int mlx5e_hv_vhca_stats_create(struct mlx5e_priv
> *priv)
>                                     PTR_ERR(agent));
>  
>                 kvfree(priv->stats_agent.buf);
> -               return IS_ERR_OR_NULL(agent);
> +               return agent ? PTR_ERR(agent) : -ENODEV;

the single caller of this function ignores the return value,
I just made a patch to void the return value and added you as Reported-
by.

Thanks !
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
index d290d72..04cda3d
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
@@ -142,7 +142,7 @@  int mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv)
 				    PTR_ERR(agent));
 
 		kvfree(priv->stats_agent.buf);
-		return IS_ERR_OR_NULL(agent);
+		return agent ? PTR_ERR(agent) : -ENODEV;
 	}
 
 	priv->stats_agent.agent = agent;