* [bvanassche:thread-safety 272/460] include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
@ 2026-11-19 1:16 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-11-19 1:16 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Bart Van Assche <bvanassche@acm.org>
tree: https://github.com/bvanassche/linux thread-safety
head: 754c0efaaee1c85b67fd7f8a45f7be89900b661f
commit: b92d6bdb8a97a9e35c1baf80d282833e714e75de [272/460] spi: Convert to_spi_device() into an inline function
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
config: i386-randconfig-2200-20261118 (https://download.01.org/0day-ci/archive/20261119/20261119020747.MyvHiLUM-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261119/20261119020747.MyvHiLUM-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/r/20261119020747.MyvHiLUM-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from drivers/mux/adgs1408.c:12:
>> 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/mux/adgs1408.c: In function 'adgs1408_set':
>> drivers/mux/adgs1408.c:37:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Werror=implicit-function-declaration]
37 | struct spi_device *spi = to_spi_device(mux->chip->dev.parent);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/mux/adgs1408.c:37: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/gpio/gpio-pisosr.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)
| ^~~~~~
--
In file included from drivers/gpio/gpio-max3191x.c:39:
>> 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/gpio/gpio-max3191x.c: In function 'max3191x_readout_locked':
>> drivers/gpio/gpio-max3191x.c:114:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Werror=implicit-function-declaration]
114 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/gpio/gpio-max3191x.c:114: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/gpio/gpio-max7301.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/gpio/gpio-max7301.c: In function 'max7301_spi_write':
>> drivers/gpio/gpio-max7301.c:22:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Werror=implicit-function-declaration]
22 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/gpio/gpio-max7301.c:22:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/gpio/gpio-max7301.c: In function 'max7301_spi_read':
drivers/gpio/gpio-max7301.c:34:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
34 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from drivers/bus/moxtet.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/bus/moxtet.c: In function 'moxtet_find_topology':
>> drivers/bus/moxtet.c:341:24: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Werror=implicit-function-declaration]
341 | ret = spi_read(to_spi_device(moxtet->dev), buf, TURRIS_MOX_MAX_MODULES);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/bus/moxtet.c:341:24: warning: passing argument 1 of 'spi_read' makes pointer from integer without a cast [-Wint-conversion]
341 | ret = spi_read(to_spi_device(moxtet->dev), buf, TURRIS_MOX_MAX_MODULES);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
include/linux/spi/spi.h:1583:29: note: expected 'struct spi_device *' but argument is of type 'int'
1583 | spi_read(struct spi_device *spi, void *buf, size_t len)
| ~~~~~~~~~~~~~~~~~~~^~~
drivers/bus/moxtet.c: In function 'moxtet_spi_read':
>> drivers/bus/moxtet.c:397:33: warning: passing argument 1 of 'spi_sync_transfer' makes pointer from integer without a cast [-Wint-conversion]
397 | ret = spi_sync_transfer(to_spi_device(moxtet->dev), &xfer, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
include/linux/spi/spi.h:1537:38: note: expected 'struct spi_device *' but argument is of type 'int'
1537 | spi_sync_transfer(struct spi_device *spi, struct spi_transfer *xfers,
| ~~~~~~~~~~~~~~~~~~~^~~
drivers/bus/moxtet.c: In function 'moxtet_device_write':
>> drivers/bus/moxtet.c:435:25: warning: passing argument 1 of 'spi_write' makes pointer from integer without a cast [-Wint-conversion]
435 | ret = spi_write(to_spi_device(moxtet->dev), moxtet->tx,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
include/linux/spi/spi.h:1560:30: note: expected 'struct spi_device *' but argument is of type 'int'
1560 | spi_write(struct spi_device *spi, const void *buf, size_t len)
| ~~~~~~~~~~~~~~~~~~~^~~
drivers/bus/moxtet.c: In function 'output_write':
drivers/bus/moxtet.c:539:25: warning: passing argument 1 of 'spi_write' makes pointer from integer without a cast [-Wint-conversion]
539 | err = spi_write(to_spi_device(moxtet->dev), moxtet->tx,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
include/linux/spi/spi.h:1560:30: note: expected 'struct spi_device *' but argument is of type 'int'
1560 | spi_write(struct spi_device *spi, const void *buf, size_t len)
| ~~~~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
--
In file included from drivers/spi/spi.c:35:
>> 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/spi/spi.c: In function 'spidev_release':
>> drivers/spi/spi.c:53:40: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Werror=implicit-function-declaration]
53 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/spi/spi.c:53:40: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/spi/spi.c: In function 'modalias_show':
>> drivers/spi/spi.c:63:40: warning: initialization of 'const struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
63 | const struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_messages_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:175:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
175 | SPI_STATISTICS_SHOW(messages);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfers_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:176:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
176 | SPI_STATISTICS_SHOW(transfers);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_errors_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:177:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
177 | SPI_STATISTICS_SHOW(errors);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_timedout_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:178:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
178 | SPI_STATISTICS_SHOW(timedout);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_spi_sync_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:180:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
180 | SPI_STATISTICS_SHOW(spi_sync);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_spi_sync_immediate_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:181:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
181 | SPI_STATISTICS_SHOW(spi_sync_immediate);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_spi_async_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:182:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
182 | SPI_STATISTICS_SHOW(spi_async);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_bytes_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
--
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:203:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
203 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(11, "2048-4095");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo12_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:204:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
204 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(12, "4096-8191");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo13_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:205:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
205 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(13, "8192-16383");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo14_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:206:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
206 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(14, "16384-32767");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo15_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:207:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
207 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(15, "32768-65535");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo16_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:208:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
208 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(16, "65536+");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfers_split_maxsize_show':
drivers/spi/spi.c:154:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:210:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
210 | SPI_STATISTICS_SHOW(transfers_split_maxsize);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_match_device':
drivers/spi/spi.c:560:40: warning: initialization of 'const struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
560 | const struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_uevent':
drivers/spi/spi.c:585:48: warning: initialization of 'const struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
585 | const struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_probe':
drivers/spi/spi.c:598:48: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
598 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_remove':
>> drivers/spi/spi.c:631:30: warning: passing argument 1 of 'sdrv->remove' makes pointer from integer without a cast [-Wint-conversion]
631 | sdrv->remove(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/spi/spi.c:631:30: note: expected 'struct spi_device *' but argument is of type 'int'
drivers/spi/spi.c: In function 'spi_shutdown':
>> drivers/spi/spi.c:640:40: warning: passing argument 1 of 'sdrv->shutdown' makes pointer from integer without a cast [-Wint-conversion]
640 | sdrv->shutdown(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/spi/spi.c:640:40: note: expected 'struct spi_device *' but argument is of type 'int'
drivers/spi/spi.c: In function 'spi_dev_check':
drivers/spi/spi.c:836:34: warning: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
836 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function '__unregister':
>> drivers/spi/spi.c:3870:31: warning: passing argument 1 of 'spi_unregister_device' makes pointer from integer without a cast [-Wint-conversion]
3870 | spi_unregister_device(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/spi/spi.c:1069:47: note: expected 'struct spi_device *' but argument is of type 'int'
1069 | void spi_unregister_device(struct spi_device *spi)
| ~~~~~~~~~~~~~~~~~~~^~~
drivers/spi/spi.c: In function 'of_find_spi_device_by_node':
>> drivers/spi/spi.c:5272:41: warning: pointer/integer type mismatch in conditional expression
5272 | return dev ? to_spi_device(dev) : NULL;
| ^
drivers/spi/spi.c: In function 'acpi_spi_find_device_by_adev':
>> drivers/spi/spi.c:5359:16: warning: returning 'int' from a function with return type 'struct spi_device *' makes pointer from integer without a cast [-Wint-conversion]
5359 | return to_spi_device(dev);
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
..
vim +284 include/linux/spi/spi.h
8ae12a0d85987d David Brownell 2006-01-08 279
d962608ce2188a Dragos Bogdan 2020-12-21 280 /* Make sure that SPI_MODE_KERNEL_MASK & SPI_MODE_USER_MASK don't overlap */
d962608ce2188a Dragos Bogdan 2020-12-21 281 static_assert((SPI_MODE_KERNEL_MASK & SPI_MODE_USER_MASK) == 0,
d962608ce2188a Dragos Bogdan 2020-12-21 282 "SPI_MODE_USER_MASK & SPI_MODE_KERNEL_MASK must not overlap");
d962608ce2188a Dragos Bogdan 2020-12-21 283
b92d6bdb8a97a9 Bart Van Assche 2026-11-15 @284 static inline struct spi_device *to_spi_device(struct device *dev)
b92d6bdb8a97a9 Bart Van Assche 2026-11-15 285 __attribute__((overloadable))
b92d6bdb8a97a9 Bart Van Assche 2026-11-15 286 {
b92d6bdb8a97a9 Bart Van Assche 2026-11-15 287 return container_of(dev, struct spi_device, dev);
b92d6bdb8a97a9 Bart Van Assche 2026-11-15 288 }
b92d6bdb8a97a9 Bart Van Assche 2026-11-15 289
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* [bvanassche:thread-safety 272/460] include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition
@ 2026-11-19 3:11 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-11-19 3:11 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Bart Van Assche <bvanassche@acm.org>
tree: https://github.com/bvanassche/linux thread-safety
head: 754c0efaaee1c85b67fd7f8a45f7be89900b661f
commit: b92d6bdb8a97a9e35c1baf80d282833e714e75de [272/460] spi: Convert to_spi_device() into an inline function
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20261119/20261119040205.imXaG5Cp-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261119/20261119040205.imXaG5Cp-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/r/20261119040205.imXaG5Cp-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/rtc/rtc-ds3232.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)
| ^~~~~~
--
In file included from drivers/rtc/rtc-rx4581.c:31:
>> 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/rtc/rtc-rx4581.c: In function 'rx4581_set_reg':
>> drivers/rtc/rtc-rx4581.c:69:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Wimplicit-function-declaration]
69 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/rtc/rtc-rx4581.c:69:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/rtc/rtc-rx4581.c: In function 'rx4581_get_reg':
drivers/rtc/rtc-rx4581.c:82:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
82 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/rtc/rtc-rx4581.c: In function 'rx4581_get_datetime':
drivers/rtc/rtc-rx4581.c:96:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
96 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/rtc/rtc-rx4581.c: In function 'rx4581_set_datetime':
drivers/rtc/rtc-rx4581.c:172:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
172 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
--
In file included from drivers/spi/spi.c:35:
>> 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/spi/spi.c: In function 'spidev_release':
>> drivers/spi/spi.c:53:40: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Wimplicit-function-declaration]
53 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
| to_acpi_device
>> drivers/spi/spi.c:53:40: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/spi/spi.c: In function 'modalias_show':
>> drivers/spi/spi.c:63:40: error: initialization of 'const struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
63 | const struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_messages_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:175:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
175 | SPI_STATISTICS_SHOW(messages);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfers_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:176:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
176 | SPI_STATISTICS_SHOW(transfers);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_errors_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:177:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
177 | SPI_STATISTICS_SHOW(errors);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_timedout_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:178:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
178 | SPI_STATISTICS_SHOW(timedout);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_spi_sync_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:180:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
180 | SPI_STATISTICS_SHOW(spi_sync);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_spi_sync_immediate_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:181:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
181 | SPI_STATISTICS_SHOW(spi_sync_immediate);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_spi_async_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:182:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
182 | SPI_STATISTICS_SHOW(spi_async);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_bytes_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
--
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:203:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
203 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(11, "2048-4095");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo12_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:204:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
204 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(12, "4096-8191");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo13_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:205:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
205 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(13, "8192-16383");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo14_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:206:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
206 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(14, "16384-32767");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo15_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:207:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
207 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(15, "32768-65535");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfer_bytes_histo16_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:189:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
189 | SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:208:1: note: in expansion of macro 'SPI_STATISTICS_TRANSFER_BYTES_HISTO'
208 | SPI_STATISTICS_TRANSFER_BYTES_HISTO(16, "65536+");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_device_transfers_split_maxsize_show':
drivers/spi/spi.c:154:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
154 | struct spi_device *spi = to_spi_device(dev); \
| ^~~~~~~~~~~~~
drivers/spi/spi.c:169:1: note: in expansion of macro 'SPI_STATISTICS_ATTRS'
169 | SPI_STATISTICS_ATTRS(name, file)
| ^~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:172:9: note: in expansion of macro 'SPI_STATISTICS_SHOW_NAME'
172 | SPI_STATISTICS_SHOW_NAME(field, __stringify(field), \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c:210:1: note: in expansion of macro 'SPI_STATISTICS_SHOW'
210 | SPI_STATISTICS_SHOW(transfers_split_maxsize);
| ^~~~~~~~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_match_device':
drivers/spi/spi.c:560:40: error: initialization of 'const struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
560 | const struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_uevent':
drivers/spi/spi.c:585:48: error: initialization of 'const struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
585 | const struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_probe':
drivers/spi/spi.c:598:48: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
598 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function 'spi_remove':
>> drivers/spi/spi.c:631:30: error: passing argument 1 of 'sdrv->remove' makes pointer from integer without a cast [-Wint-conversion]
631 | sdrv->remove(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/spi/spi.c:631:30: note: expected 'struct spi_device *' but argument is of type 'int'
drivers/spi/spi.c: In function 'spi_shutdown':
>> drivers/spi/spi.c:640:40: error: passing argument 1 of 'sdrv->shutdown' makes pointer from integer without a cast [-Wint-conversion]
640 | sdrv->shutdown(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/spi/spi.c:640:40: note: expected 'struct spi_device *' but argument is of type 'int'
drivers/spi/spi.c: In function 'spi_dev_check':
drivers/spi/spi.c:836:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
836 | struct spi_device *spi = to_spi_device(dev);
| ^~~~~~~~~~~~~
drivers/spi/spi.c: In function '__unregister':
>> drivers/spi/spi.c:3870:31: error: passing argument 1 of 'spi_unregister_device' makes pointer from integer without a cast [-Wint-conversion]
3870 | spi_unregister_device(to_spi_device(dev));
| ^~~~~~~~~~~~~~~~~~
| |
| int
drivers/spi/spi.c:1069:47: note: expected 'struct spi_device *' but argument is of type 'int'
1069 | void spi_unregister_device(struct spi_device *spi)
| ~~~~~~~~~~~~~~~~~~~^~~
drivers/spi/spi.c: In function 'acpi_spi_find_device_by_adev':
>> drivers/spi/spi.c:5359:16: error: returning 'int' from a function with return type 'struct spi_device *' makes pointer from integer without a cast [-Wint-conversion]
5359 | return to_spi_device(dev);
| ^~~~~~~~~~~~~~~~~~
--
In file included from sound/soc/codecs/cs35l56-shared.c:20:
>> 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)
| ^~~~~~
sound/soc/codecs/cs35l56-shared.c: In function 'cs35l56_spi_system_reset':
>> sound/soc/codecs/cs35l56-shared.c:515:34: error: implicit declaration of function 'to_spi_device'; did you mean 'to_acpi_device'? [-Wimplicit-function-declaration]
515 | struct spi_device *spi = to_spi_device(cs35l56_base->dev);
| ^~~~~~~~~~~~~
| to_acpi_device
>> sound/soc/codecs/cs35l56-shared.c:515:34: error: initialization of 'struct spi_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
..
vim +284 include/linux/spi/spi.h
8ae12a0d85987dc David Brownell 2006-01-08 279
d962608ce2188a1 Dragos Bogdan 2020-12-21 280 /* Make sure that SPI_MODE_KERNEL_MASK & SPI_MODE_USER_MASK don't overlap */
d962608ce2188a1 Dragos Bogdan 2020-12-21 281 static_assert((SPI_MODE_KERNEL_MASK & SPI_MODE_USER_MASK) == 0,
d962608ce2188a1 Dragos Bogdan 2020-12-21 282 "SPI_MODE_USER_MASK & SPI_MODE_KERNEL_MASK must not overlap");
d962608ce2188a1 Dragos Bogdan 2020-12-21 283
b92d6bdb8a97a9e Bart Van Assche 2026-11-15 @284 static inline struct spi_device *to_spi_device(struct device *dev)
b92d6bdb8a97a9e Bart Van Assche 2026-11-15 285 __attribute__((overloadable))
b92d6bdb8a97a9e Bart Van Assche 2026-11-15 286 {
b92d6bdb8a97a9e Bart Van Assche 2026-11-15 287 return container_of(dev, struct spi_device, dev);
b92d6bdb8a97a9e Bart Van Assche 2026-11-15 288 }
b92d6bdb8a97a9e Bart Van Assche 2026-11-15 289
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-19 3:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 1:16 [bvanassche:thread-safety 272/460] include/linux/spi/spi.h:284:1: error: attributes should be specified before the declarator in a function definition kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2026-11-19 3:11 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.