drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:981 mlx5_esw_vport_vhca_id() warn: signedness bug returning '(-45)'
From: Dan Carpenter
Date: Thu Dec 18 2025 - 02:07:33 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ea1013c1539270e372fc99854bc6e4d94eaeff66
commit: 1baf30426553efb3ac518b0e9d5c1c3f8ed7762a net/mlx5: E-Switch, Set/Query hca cap via vhca id
config: alpha-randconfig-r073-20251217 (https://download.01.org/0day-ci/archive/20251218/202512180851.WNLFBz7t-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 14.3.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202512180851.WNLFBz7t-lkp@xxxxxxxxx/
smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:981 mlx5_esw_vport_vhca_id() warn: signedness bug returning '(-45)'
vim +981 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
1baf30426553efb Saeed Mahameed 2025-06-16 978 static inline bool
1baf30426553efb Saeed Mahameed 2025-06-16 979 mlx5_esw_vport_vhca_id(struct mlx5_eswitch *esw, u16 vportn, u16 *vhca_id)
1baf30426553efb Saeed Mahameed 2025-06-16 980 {
1baf30426553efb Saeed Mahameed 2025-06-16 @981 return -EOPNOTSUPP;
This should be either true or false since it's a bool function.
1baf30426553efb Saeed Mahameed 2025-06-16 982 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki