* [PATCH v3 net] net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id()
@ 2026-01-23 8:57 Zeng Chi
2026-01-25 6:46 ` Tariq Toukan
2026-01-25 22:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Zeng Chi @ 2026-01-23 8:57 UTC (permalink / raw)
To: saeedm, leon, tariqt, mbloch, davem, andrew+netdev, edumazet,
kuba, pabeni, feliu, parav, witu, ajayachandra
Cc: netdev, linux-rdma, linux-kernel, Zeng Chi
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 */
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v3 net] net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id()
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
2026-01-25 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-01-25 6:46 UTC (permalink / raw)
To: Zeng Chi, saeedm, leon, tariqt, mbloch, davem, andrew+netdev,
edumazet, kuba, pabeni, feliu, parav, witu, ajayachandra
Cc: netdev, linux-rdma, linux-kernel, Zeng Chi
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>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v3 net] net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id()
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
@ 2026-01-25 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-25 22:50 UTC (permalink / raw)
To: Zeng Chi
Cc: saeedm, leon, tariqt, mbloch, davem, andrew+netdev, edumazet,
kuba, pabeni, feliu, parav, witu, ajayachandra, netdev,
linux-rdma, linux-kernel, zengchi
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 23 Jan 2026 16:57:49 +0800 you 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)'
>
> [...]
Here is the summary with links:
- [v3,net] net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id()
https://git.kernel.org/netdev/net/c/ca12c4a155eb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-25 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-01-25 22:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox