From: Simon Horman <horms@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Eran Ben Elisha <eranbe@nvidia.com>, Feng Liu <feliu@nvidia.com>,
Gal Pressman <gal@nvidia.com>, Kees Cook <kees@kernel.org>,
Leon Romanovsky <leon@kernel.org>,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
Mark Bloch <mbloch@nvidia.com>,
Michael Guralnik <michaelgur@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>, Shay Drori <shayd@nvidia.com>
Subject: Re: [PATCH net-next] net/mlx5: rsc_dump and hv_vhca return NULL on create error
Date: Thu, 13 Aug 2026 10:26:55 +0100 [thread overview]
Message-ID: <20260813092655.GB196815@horms.kernel.org> (raw)
In-Reply-To: <20260811061637.3195320-1-tariqt@nvidia.com>
On Tue, Aug 11, 2026 at 09:16:37AM +0300, Tariq Toukan wrote:
> From: Michael Guralnik <michaelgur@nvidia.com>
>
> 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@nvidia.com>
> Reviewed-by: Shay Drori <shayd@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
...
> 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@kernel.org>
next prev parent reply other threads:[~2026-08-13 9:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 6:16 [PATCH net-next] net/mlx5: rsc_dump and hv_vhca return NULL on create error Tariq Toukan
2026-08-13 9:26 ` Simon Horman [this message]
2026-08-13 11:33 ` Paolo Abeni
2026-08-13 11:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260813092655.GB196815@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eranbe@nvidia.com \
--cc=feliu@nvidia.com \
--cc=gal@nvidia.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=michaelgur@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=shayd@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).