public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Zeng Chi <zeng_chi911@163.com>,
	saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com,
	mbloch@nvidia.com, davem@davemloft.net, andrew+netdev@lunn.ch,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	feliu@nvidia.com, parav@nvidia.com, witu@nvidia.com,
	ajayachandra@nvidia.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, Zeng Chi <zengchi@kylinos.cn>
Subject: Re: [PATCH v3 net] net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id()
Date: Sun, 25 Jan 2026 08:46:23 +0200	[thread overview]
Message-ID: <56f850d0-efbe-462d-9034-d1c11453cff2@gmail.com> (raw)
In-Reply-To: <20260123085749.1401969-1-zeng_chi911@163.com>



On 23/01/2026 10:57, Zeng Chi wrote:
> From: Zeng Chi <zengchi@kylinos.cn>
> 
> The function mlx5_esw_vport_vhca_id() is declared to return bool,
> but returns -EOPNOTSUPP (-45), which is an int error code. This
> causes a signedness bug as reported by smatch.
> 
> This patch fixes this smatch report:
> drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:981 mlx5_esw_vport_vhca_id()
> warn: signedness bug returning '(-45)'
> 
> Fixes: 1baf30426553 ("net/mlx5: E-Switch, Set/Query hca cap via vhca id")
> Reviewed-by: Parav Pandit <parav@nvidia.com>
> Signed-off-by: Zeng Chi <zengchi@kylinos.cn>
> ---
> v2 -> v3:
> - Shortened the commit ID in the `Fixes:` tag to 12 characters as suggested.
> - Added a `Reviewed-by:` tag from Parav Pandit <parav@nvidia.com>.
> 
> v2:Added the required Fixes tag and specified target branch net in subject prefix
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> index ad1073f7b79f..e7fe43799b23 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> @@ -1009,7 +1009,7 @@ mlx5_esw_host_functions_enabled(const struct mlx5_core_dev *dev)
>   static inline bool
>   mlx5_esw_vport_vhca_id(struct mlx5_eswitch *esw, u16 vportn, u16 *vhca_id)
>   {
> -	return -EOPNOTSUPP;
> +	return false;
>   }
>   
>   #endif /* CONFIG_MLX5_ESWITCH */

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>


  reply	other threads:[~2026-01-25  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23  8:57 [PATCH v3 net] net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id() Zeng Chi
2026-01-25  6:46 ` Tariq Toukan [this message]
2026-01-25 22:50 ` 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=56f850d0-efbe-462d-9034-d1c11453cff2@gmail.com \
    --to=ttoukan.linux@gmail.com \
    --cc=ajayachandra@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=feliu@nvidia.com \
    --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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=witu@nvidia.com \
    --cc=zeng_chi911@163.com \
    --cc=zengchi@kylinos.cn \
    /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