Commit 20f80ffc authored by Saeed Mahameed's avatar Saeed Mahameed
Browse files

net/mlx5: mlx5e_hv_vhca_stats_create return type to void



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: default avatarWang Qing <wangqing@vivo.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 710ad98c
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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)
+3 −10
Original line number Diff line number Diff line
@@ -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__ */