net/mlx5: mlx5e_hv_vhca_stats_create return type to void
authorSaeed Mahameed <saeedm@nvidia.com>
Thu, 23 Dec 2021 19:28:09 +0000 (11:28 -0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 7 Jan 2022 00:22:50 +0000 (16:22 -0800)
Callers of this functions ignore its return value, as reported by
Wang Qing, in one of the return paths, it returns positive values.

Since return value is ignored anyways, void out the return type of the
function.

Reported-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.h

index 074ffa4..b4f3bd7 100644 (file)
@@ -120,14 +120,14 @@ static void mlx5e_hv_vhca_stats_cleanup(struct mlx5_hv_vhca_agent *agent)
        cancel_delayed_work_sync(&priv->stats_agent.work);
 }
 
-int mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv)
+void mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv)
 {
        int buf_len = mlx5e_hv_vhca_stats_buf_size(priv);
        struct mlx5_hv_vhca_agent *agent;
 
        priv->stats_agent.buf = kvzalloc(buf_len, GFP_KERNEL);
        if (!priv->stats_agent.buf)
-               return -ENOMEM;
+               return;
 
        agent = mlx5_hv_vhca_agent_create(priv->mdev->hv_vhca,
                                          MLX5_HV_VHCA_AGENT_STATS,
@@ -142,13 +142,11 @@ 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;
        }
 
        priv->stats_agent.agent = agent;
        INIT_DELAYED_WORK(&priv->stats_agent.work, mlx5e_hv_vhca_stats_work);
-
-       return 0;
 }
 
 void mlx5e_hv_vhca_stats_destroy(struct mlx5e_priv *priv)
index 664463f..29c8c6d 100644 (file)
@@ -7,19 +7,12 @@
 
 #if IS_ENABLED(CONFIG_PCI_HYPERV_INTERFACE)
 
-int mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv);
+void mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv);
 void mlx5e_hv_vhca_stats_destroy(struct mlx5e_priv *priv);
 
 #else
-
-static inline int mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv)
-{
-       return 0;
-}
-
-static inline void mlx5e_hv_vhca_stats_destroy(struct mlx5e_priv *priv)
-{
-}
+static inline void mlx5e_hv_vhca_stats_create(struct mlx5e_priv *priv) {}
+static inline void mlx5e_hv_vhca_stats_destroy(struct mlx5e_priv *priv) {}
 #endif
 
 #endif /* __MLX5_EN_STATS_VHCA_H__ */