* [bvanassche:thread-safety 272/460] drivers/misc/lis3lv02d/lis3lv02d_spi.c:110:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'?
@ 2026-11-19 1:05 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-19 1:05 UTC (permalink / raw)
To: Bart Van Assche; +Cc: oe-kbuild-all
tree: https://github.com/bvanassche/linux thread-safety
head: 754c0efaaee1c85b67fd7f8a45f7be89900b661f
commit: b92d6bdb8a97a9e35c1baf80d282833e714e75de [272/460] spi: Convert to_spi_device() into an inline function
config: sh-randconfig-2200-20261118 (https://download.01.org/0day-ci/archive/20261119/20261119015509.C5jFelNp-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 13.5.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261119/20261119015509.C5jFelNp-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261119015509.C5jFelNp-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from drivers/hwmon/max1111.c:19:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/hwmon/max1111.c: In function 'name_show':
drivers/hwmon/max1111.c:102:37: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
102 | return sprintf(buf, "%s\n", to_spi_device(dev)->modalias);
| ^~~~~~~~~~~~~
| to_spi_driver
drivers/hwmon/max1111.c:102:55: error: invalid type argument of '->' (have 'int')
102 | return sprintf(buf, "%s\n", to_spi_device(dev)->modalias);
| ^~
>> drivers/hwmon/max1111.c:103:1: warning: control reaches end of non-void function [-Wreturn-type]
103 | }
| ^
cc1: some warnings being treated as errors
--
In file included from drivers/hwmon/max31722.c:13:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/hwmon/max31722.c: In function 'max31722_suspend':
drivers/hwmon/max31722.c:119:41: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
119 | struct spi_device *spi_device = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/hwmon/max31722.c:119:41: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/hwmon/max31722.c: In function 'max31722_resume':
drivers/hwmon/max31722.c:127:41: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
127 | struct spi_device *spi_device = to_spi_device(dev);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/input/joystick/psxpad-spi.c:26:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/input/joystick/psxpad-spi.c: In function 'psxpad_spi_suspend':
drivers/input/joystick/psxpad-spi.c:384:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
384 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/input/joystick/psxpad-spi.c:384:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
cc1: some warnings being treated as errors
--
In file included from drivers/mfd/sprd-sc27xx-spi.c:14:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/mfd/sprd-sc27xx-spi.c: In function 'sprd_pmic_detect_charger_type':
drivers/mfd/sprd-sc27xx-spi.c:101:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
101 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/mfd/sprd-sc27xx-spi.c:101:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/mfd/sprd-sc27xx-spi.c: In function 'sprd_pmic_spi_write':
drivers/mfd/sprd-sc27xx-spi.c:139:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
139 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/mfd/sprd-sc27xx-spi.c: In function 'sprd_pmic_spi_read':
drivers/mfd/sprd-sc27xx-spi.c:149:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
149 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/misc/lis3lv02d/lis3lv02d_spi.c:14:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/misc/lis3lv02d/lis3lv02d_spi.c: In function 'lis3lv02d_spi_suspend':
>> drivers/misc/lis3lv02d/lis3lv02d_spi.c:110:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
110 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/misc/lis3lv02d/lis3lv02d_spi.c:110:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/misc/lis3lv02d/lis3lv02d_spi.c: In function 'lis3lv02d_spi_resume':
drivers/misc/lis3lv02d/lis3lv02d_spi.c:121:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
121 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/input/touchscreen/tsc2005.c:15:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/input/touchscreen/tsc2005.c: In function 'tsc2005_cmd':
>> drivers/input/touchscreen/tsc2005.c:33:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
33 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/input/touchscreen/tsc2005.c:33:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
cc1: some warnings being treated as errors
--
In file included from drivers/input/touchscreen/surface3_spi.c:18:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/input/touchscreen/surface3_spi.c: In function 'surface3_spi_suspend':
>> drivers/input/touchscreen/surface3_spi.c:367:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
367 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/input/touchscreen/surface3_spi.c:367:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/input/touchscreen/surface3_spi.c: In function 'surface3_spi_resume':
drivers/input/touchscreen/surface3_spi.c:379:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
379 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/input/touchscreen/ads7846.c:29:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/input/touchscreen/ads7846.c: In function 'ads7846_read12_ser':
>> drivers/input/touchscreen/ads7846.c:354:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
354 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/input/touchscreen/ads7846.c:354:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/input/touchscreen/ads7846.c: In function 'ads7845_read12_ser':
drivers/input/touchscreen/ads7846.c:436:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
436 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/input/touchscreen/apple_z2.c:16:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/input/touchscreen/apple_z2.c: In function 'apple_z2_suspend':
>> drivers/input/touchscreen/apple_z2.c:437:27: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? [-Werror=implicit-function-declaration]
437 | apple_z2_shutdown(to_spi_device(dev));
| ^~~~~~~~~~~~~
| to_spi_driver
>> drivers/input/touchscreen/apple_z2.c:437:27: warning: passing argument 1 of 'apple_z2_shutdown' makes pointer from integer without a cast [-Wint-conversion]
437 | apple_z2_shutdown(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/input/touchscreen/apple_z2.c:426:50: note: expected 'struct spi_device *' but argument is of type 'int'
426 | static void apple_z2_shutdown(struct spi_device *spi)
| ~~~~~~~~~~~~~~~~~~~^~~
drivers/input/touchscreen/apple_z2.c: In function 'apple_z2_resume':
>> drivers/input/touchscreen/apple_z2.c:444:47: warning: passing argument 1 of 'spi_get_drvdata' makes pointer from integer without a cast [-Wint-conversion]
444 | struct apple_z2 *z2 = spi_get_drvdata(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
include/linux/spi/spi.h:332:62: note: expected 'const struct spi_device *' but argument is of type 'int'
332 | static inline void *spi_get_drvdata(const struct spi_device *spi)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
--
In file included from drivers/usb/host/max3421-hcd.c:61:
include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
284 | static inline struct spi_device *to_spi_device(struct device *dev)
| ^~~~~~
include/linux/spi/spi.h:290:1: error: attributes should be specified before the declarator in a function definition
290 | static inline struct spi_device *to_spi_device(void *dev)
| ^~~~~~
include/linux/spi/spi.h:296:1: error: attributes should be specified before the declarator in a function definition
296 | static inline const struct spi_device *to_spi_device(const struct device *dev)
| ^~~~~~
drivers/usb/host/max3421-hcd.c: In function 'spi_rd8':
>> drivers/usb/host/max3421-hcd.c:344:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_usb_device'? [-Werror=implicit-function-declaration]
344 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
| to_usb_device
>> drivers/usb/host/max3421-hcd.c:344:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/usb/host/max3421-hcd.c: In function 'spi_wr8':
drivers/usb/host/max3421-hcd.c:369:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
369 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'spi_rd_buf':
drivers/usb/host/max3421-hcd.c:393:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
393 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'spi_wr_buf':
drivers/usb/host/max3421-hcd.c:419:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
419 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_transfer_out':
drivers/usb/host/max3421-hcd.c:525:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
525 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_select_and_start_urb':
drivers/usb/host/max3421-hcd.c:631:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
631 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_check_unlink':
drivers/usb/host/max3421-hcd.c:766:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
766 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_handle_error':
drivers/usb/host/max3421-hcd.c:852:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
852 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_transfer_in_done':
drivers/usb/host/max3421-hcd.c:941:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
941 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_irq_handler':
drivers/usb/host/max3421-hcd.c:1136:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1136 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_reset_hcd':
drivers/usb/host/max3421-hcd.c:1285:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1285 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_spi_thread':
drivers/usb/host/max3421-hcd.c:1374:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1374 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_urb_enqueue':
drivers/usb/host/max3421-hcd.c:1501:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1501 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
drivers/usb/host/max3421-hcd.c: In function 'max3421_hub_control':
drivers/usb/host/max3421-hcd.c:1674:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1674 | struct spi_device *spi = to_spi_device(hcd->self.controller);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +110 drivers/misc/lis3lv02d/lis3lv02d_spi.c
bb233fdfc7b7cef drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-03-31 107
4e9be650597bffe drivers/hwmon/lis3lv02d_spi.c Mark Brown 2011-01-20 108 static int lis3lv02d_spi_suspend(struct device *dev)
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 109 {
4e9be650597bffe drivers/hwmon/lis3lv02d_spi.c Mark Brown 2011-01-20 @110 struct spi_device *spi = to_spi_device(dev);
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 111 struct lis3lv02d *lis3 = spi_get_drvdata(spi);
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 112
5facb097137e750 drivers/hwmon/lis3lv02d_spi.c Kuninori Morimoto 2010-09-17 113 if (!lis3->pdata || !lis3->pdata->wakeup_flags)
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 114 lis3lv02d_poweroff(&lis3_dev);
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 115
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 116 return 0;
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 117 }
2cd9645e2f0d60e drivers/hwmon/lis3lv02d_spi.c Daniel Mack 2009-09-21 118
:::::: The code at line 110 was first introduced by commit
:::::: 4e9be650597bffec5885a8c1abad1e4ffb0bcca3 hwmon: (lis3lv02d) Convert SPI to dev_pm_ops
:::::: TO: Mark Brown <broonie@opensource.wolfsonmicro.com>
:::::: CC: Guenter Roeck <guenter.roeck@ericsson.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-19 1:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 1:05 [bvanassche:thread-safety 272/460] drivers/misc/lis3lv02d/lis3lv02d_spi.c:110:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_spi_driver'? kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.