drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:1069:13: warning: variable 'max_possible_vfs' set but not used

From: kernel test robot
Date: Sun Nov 05 2023 - 07:55:39 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1c41041124bd14dd6610da256a3da4e5b74ce6b1
commit: d13520c7ca7761346d2787fff1b3b112f87da77a liquidio CN23XX: HW config for VF support
date: 7 years ago
config: x86_64-buildonly-randconfig-002-20231101 (https://download.01.org/0day-ci/archive/20231105/202311052041.0lSUJmvT-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231105/202311052041.0lSUJmvT-lkp@xxxxxxxxx/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311052041.0lSUJmvT-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from include/linux/kobject.h:21,
from include/linux/pci.h:28,
from drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:23:
include/linux/sysfs.h: In function 'sysfs_get_dirent':
include/linux/sysfs.h:517:44: warning: pointer targets in passing argument 2 of 'kernfs_find_and_get' differ in signedness [-Wpointer-sign]
517 | return kernfs_find_and_get(parent, name);
| ^~~~
| |
| const unsigned char *
In file included from include/linux/sysfs.h:15:
include/linux/kernfs.h:452:57: note: expected 'const char *' but argument is of type 'const unsigned char *'
452 | kernfs_find_and_get(struct kernfs_node *kn, const char *name)
| ~~~~~~~~~~~~^~~~
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c: In function 'cn23xx_sriov_config':
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:1117:24: error: 'struct octeon_sriov_info' has no member named 'sriov_enabled'
1117 | oct->sriov_info.sriov_enabled = 0;
| ^
>> drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:1069:13: warning: variable 'max_possible_vfs' set but not used [-Wunused-but-set-variable]
1069 | u32 max_possible_vfs;
| ^~~~~~~~~~~~~~~~
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c: At top level:
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c:1210:6: warning: no previous declaration for 'cn23xx_dump_iq_regs' [-Wmissing-declarations]
1210 | void cn23xx_dump_iq_regs(struct octeon_device *oct)
| ^~~~~~~~~~~~~~~~~~~


vim +/max_possible_vfs +1069 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c

1063
1064 static int cn23xx_sriov_config(struct octeon_device *oct)
1065 {
1066 struct octeon_cn23xx_pf *cn23xx = (struct octeon_cn23xx_pf *)oct->chip;
1067 u32 max_rings, total_rings, max_vfs, rings_per_vf;
1068 u32 pf_srn, num_pf_rings;
> 1069 u32 max_possible_vfs;
1070
1071 cn23xx->conf =
1072 (struct octeon_config *)oct_get_config_info(oct, LIO_23XX);
1073 switch (oct->rev_id) {
1074 case OCTEON_CN23XX_REV_1_0:
1075 max_rings = CN23XX_MAX_RINGS_PER_PF_PASS_1_0;
1076 max_possible_vfs = CN23XX_MAX_VFS_PER_PF_PASS_1_0;
1077 break;
1078 case OCTEON_CN23XX_REV_1_1:
1079 max_rings = CN23XX_MAX_RINGS_PER_PF_PASS_1_1;
1080 max_possible_vfs = CN23XX_MAX_VFS_PER_PF_PASS_1_1;
1081 break;
1082 default:
1083 max_rings = CN23XX_MAX_RINGS_PER_PF;
1084 max_possible_vfs = CN23XX_MAX_VFS_PER_PF;
1085 break;
1086 }
1087
1088 if (max_rings <= num_present_cpus())
1089 num_pf_rings = 1;
1090 else
1091 num_pf_rings = num_present_cpus();
1092

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki