drivers/iio/magnetometer/bmc150_magn_spi.c:48:36: warning: 'bmc150_magn_acpi_match' defined but not used

From: kernel test robot
Date: Fri Nov 17 2023 - 23:45:06 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 791c8ab095f71327899023223940dd52257a4173
commit: 534536acdb25bae85a5333b7085837b3f1f72b73 iio: magn: bmc150: Introduce SPI support
date: 8 years ago
config: x86_64-buildonly-randconfig-001-20231012 (https://download.01.org/0day-ci/archive/20231118/202311181254.T7DGa79n-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/20231118/202311181254.T7DGa79n-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/202311181254.T7DGa79n-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from include/linux/kobject.h:21,
from include/linux/module.h:17,
from drivers/iio/magnetometer/bmc150_magn_spi.c:12:
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:437:57: note: expected 'const char *' but argument is of type 'const unsigned char *'
437 | kernfs_find_and_get(struct kernfs_node *kn, const char *name)
| ~~~~~~~~~~~~^~~~
drivers/iio/magnetometer/bmc150_magn_spi.c: At top level:
drivers/iio/magnetometer/bmc150_magn_spi.c:49:9: warning: missing initializer for field 'cls' of 'const struct acpi_device_id' [-Wmissing-field-initializers]
49 | {"BMC150B", 0},
| ^
In file included from drivers/iio/magnetometer/bmc150_magn_spi.c:13:
include/linux/mod_devicetable.h:192:15: note: 'cls' declared here
192 | __u32 cls;
| ^~~
drivers/iio/magnetometer/bmc150_magn_spi.c:50:9: warning: missing initializer for field 'cls' of 'const struct acpi_device_id' [-Wmissing-field-initializers]
50 | {"BMC156B", 0},
| ^
include/linux/mod_devicetable.h:192:15: note: 'cls' declared here
192 | __u32 cls;
| ^~~
>> drivers/iio/magnetometer/bmc150_magn_spi.c:48:36: warning: 'bmc150_magn_acpi_match' defined but not used [-Wunused-const-variable=]
48 | static const struct acpi_device_id bmc150_magn_acpi_match[] = {
| ^~~~~~~~~~~~~~~~~~~~~~


vim +/bmc150_magn_acpi_match +48 drivers/iio/magnetometer/bmc150_magn_spi.c

47
> 48 static const struct acpi_device_id bmc150_magn_acpi_match[] = {
49 {"BMC150B", 0},
50 {"BMC156B", 0},
51 {},
52 };
53 MODULE_DEVICE_TABLE(acpi, bmc150_magn_acpi_match);
54

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