Commit ca12c4a1 authored by Zeng Chi's avatar Zeng Chi Committed by Jakub Kicinski
Browse files

net/mlx5: Fix return type mismatch in mlx5_esw_vport_vhca_id()



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: 1baf3042 ("net/mlx5: E-Switch, Set/Query hca cap via vhca id")
Reviewed-by: default avatarParav Pandit <parav@nvidia.com>
Signed-off-by: default avatarZeng Chi <zengchi@kylinos.cn>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260123085749.1401969-1-zeng_chi911@163.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f0813bcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */