Thread (4 messages) flat view 4 messages, 4 authors, 7d ago

Re: [PATCH net-next] net/mlx5: rsc_dump and hv_vhca return NULL on create error

From: Simon Horman <horms@kernel.org>
Date: 2026-08-13 09:27:02
Also in: linux-rdma, lkml

On Tue, Aug 11, 2026 at 09:16:37AM +0300, Tariq Toukan wrote:
From: Michael Guralnik <redacted>

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 <redacted>
Reviewed-by: Shay Drori <redacted>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.h
quoted hunk ↗ jump to hunk
@@ -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@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help