Re: [PATCH net-next] net/mlx5: rsc_dump and hv_vhca return NULL on create error
From: Simon Horman
Date: Thu Aug 13 2026 - 05:32:32 EST
On Tue, Aug 11, 2026 at 09:16:37AM +0300, Tariq Toukan wrote:
> From: Michael Guralnik <michaelgur@xxxxxxxxxx>
>
> All callers of these create functions treat NULL and ERR_PTR as
> equivalent error cases. Align the return convention to NULL-on-failure
> to simplify the checks at usage sites.
>
> Since its return value is never checked and failure is non-fatal, change
> hv_vhca init function to return void.
>
> Signed-off-by: Michael Guralnik <michaelgur@xxxxxxxxxx>
> Reviewed-by: Shay Drori <shayd@xxxxxxxxxx>
> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
...
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h
> @@ -63,9 +63,9 @@ static inline void mlx5_hv_vhca_destroy(struct mlx5_hv_vhca *hv_vhca)
> {
> }
>
> -static inline int mlx5_hv_vhca_init(struct mlx5_hv_vhca *hv_vhca)
> +static inline void mlx5_hv_vhca_init(struct mlx5_hv_vhca *hv_vhca)
> {
> - return 0;
> + return;
> }
The AI-generated review on netdev-ai [1] points out that the
return; line is unnecessary and inconsistent with surrounding code.
[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260811061637.3195320-1-tariqt%40nvidia.com
But that not withstanding this looks good to me.
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>