Skip to content

Commit ca12c4a

Browse files
Zeng Chikuba-moo
authored andcommitted
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: 1baf304 ("net/mlx5: E-Switch, Set/Query hca cap via vhca id") Reviewed-by: Parav Pandit <[email protected]> Signed-off-by: Zeng Chi <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f0813bc commit ca12c4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ mlx5_esw_host_functions_enabled(const struct mlx5_core_dev *dev)
10091009
static inline bool
10101010
mlx5_esw_vport_vhca_id(struct mlx5_eswitch *esw, u16 vportn, u16 *vhca_id)
10111011
{
1012-
return -EOPNOTSUPP;
1012+
return false;
10131013
}
10141014

10151015
#endif /* CONFIG_MLX5_ESWITCH */

0 commit comments

Comments
 (0)