* drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read'
@ 2024-10-02 3:21 kernel test robot
2024-10-02 7:01 ` Javier Carrasco
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2024-10-02 3:21 UTC (permalink / raw)
To: Javier Carrasco; +Cc: oe-kbuild-all, linux-kernel, Jonathan Cameron
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e32cde8d2bd7d251a8f9b434143977ddf13dcec6
commit: c922c634bd926d84967275efbb7275b8645aa343 iio: accel: adxl367: Constify struct regmap_bus
date: 9 weeks ago
config: x86_64-randconfig-001-20231120 (https://download.01.org/0day-ci/archive/20241002/202410021111.LknEX9ne-lkp@intel.com/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/20241002/202410021111.LknEX9ne-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/202410021111.LknEX9ne-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/sched.h:38,
from include/linux/percpu.h:12,
from arch/x86/include/asm/msr.h:15,
from arch/x86/include/asm/tsc.h:10,
from arch/x86/include/asm/timex.h:6,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/iio/accel/adxl367_spi.c:8:
include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef]
19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:2888:5: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS'
2888 | #if USE_SPLIT_PTE_PTLOCKS
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef]
19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm_types_task.h:20:34: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS'
20 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:3010:5: note: in expansion of macro 'USE_SPLIT_PMD_PTLOCKS'
3010 | #if USE_SPLIT_PMD_PTLOCKS
| ^~~~~~~~~~~~~~~~~~~~~
drivers/iio/accel/adxl367_spi.c:75:21: error: variable 'adxl367_spi_regmap_bus' has initializer but incomplete type
75 | static const struct regmap_bus adxl367_spi_regmap_bus = {
| ^~~~~~~~~~
>> drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read'
76 | .read = adxl367_read,
| ^~~~
drivers/iio/accel/adxl367_spi.c:76:17: warning: excess elements in struct initializer
76 | .read = adxl367_read,
| ^~~~~~~~~~~~
drivers/iio/accel/adxl367_spi.c:76:17: note: (near initialization for 'adxl367_spi_regmap_bus')
>> drivers/iio/accel/adxl367_spi.c:77:10: error: 'const struct regmap_bus' has no member named 'write'
77 | .write = adxl367_write,
| ^~~~~
drivers/iio/accel/adxl367_spi.c:77:18: warning: excess elements in struct initializer
77 | .write = adxl367_write,
| ^~~~~~~~~~~~~
drivers/iio/accel/adxl367_spi.c:77:18: note: (near initialization for 'adxl367_spi_regmap_bus')
drivers/iio/accel/adxl367_spi.c:80:21: error: variable 'adxl367_spi_regmap_config' has initializer but incomplete type
80 | static const struct regmap_config adxl367_spi_regmap_config = {
| ^~~~~~~~~~~~~
drivers/iio/accel/adxl367_spi.c:81:10: error: 'const struct regmap_config' has no member named 'reg_bits'
81 | .reg_bits = 8,
| ^~~~~~~~
drivers/iio/accel/adxl367_spi.c:81:21: warning: excess elements in struct initializer
81 | .reg_bits = 8,
| ^
drivers/iio/accel/adxl367_spi.c:81:21: note: (near initialization for 'adxl367_spi_regmap_config')
drivers/iio/accel/adxl367_spi.c:82:10: error: 'const struct regmap_config' has no member named 'val_bits'
82 | .val_bits = 8,
| ^~~~~~~~
drivers/iio/accel/adxl367_spi.c:82:21: warning: excess elements in struct initializer
82 | .val_bits = 8,
| ^
drivers/iio/accel/adxl367_spi.c:82:21: note: (near initialization for 'adxl367_spi_regmap_config')
drivers/iio/accel/adxl367_spi.c: In function 'adxl367_spi_probe':
drivers/iio/accel/adxl367_spi.c:132:18: error: implicit declaration of function 'devm_regmap_init' [-Werror=implicit-function-declaration]
132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st,
| ^~~~~~~~~~~~~~~~
drivers/iio/accel/adxl367_spi.c:132:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st,
| ^
drivers/iio/accel/adxl367_spi.c: At top level:
drivers/iio/accel/adxl367_spi.c:75:32: error: storage size of 'adxl367_spi_regmap_bus' isn't known
75 | static const struct regmap_bus adxl367_spi_regmap_bus = {
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/iio/accel/adxl367_spi.c:80:35: error: storage size of 'adxl367_spi_regmap_config' isn't known
80 | static const struct regmap_config adxl367_spi_regmap_config = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +76 drivers/iio/accel/adxl367_spi.c
cbab791c5e2a58 Cosmin Tanislav 2022-02-14 74
c922c634bd926d Javier Carrasco 2024-07-03 75 static const struct regmap_bus adxl367_spi_regmap_bus = {
cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @76 .read = adxl367_read,
cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @77 .write = adxl367_write,
cbab791c5e2a58 Cosmin Tanislav 2022-02-14 78 };
cbab791c5e2a58 Cosmin Tanislav 2022-02-14 79
:::::: The code at line 76 was first introduced by commit
:::::: cbab791c5e2a58c123d84bd9202c054e5449bc96 iio: accel: add ADXL367 driver
:::::: TO: Cosmin Tanislav <demonsingur@gmail.com>
:::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' 2024-10-02 3:21 drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' kernel test robot @ 2024-10-02 7:01 ` Javier Carrasco 2024-10-02 7:03 ` Javier Carrasco 2024-10-03 15:13 ` Philip Li 0 siblings, 2 replies; 5+ messages in thread From: Javier Carrasco @ 2024-10-02 7:01 UTC (permalink / raw) To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel, Jonathan Cameron On 02/10/2024 05:21, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: e32cde8d2bd7d251a8f9b434143977ddf13dcec6 > commit: c922c634bd926d84967275efbb7275b8645aa343 iio: accel: adxl367: Constify struct regmap_bus > date: 9 weeks ago > config: x86_64-randconfig-001-20231120 (https://download.01.org/0day-ci/archive/20241002/202410021111.LknEX9ne-lkp@intel.com/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/20241002/202410021111.LknEX9ne-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/202410021111.LknEX9ne-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > In file included from include/linux/sched.h:38, > from include/linux/percpu.h:12, > from arch/x86/include/asm/msr.h:15, > from arch/x86/include/asm/tsc.h:10, > from arch/x86/include/asm/timex.h:6, > from include/linux/timex.h:67, > from include/linux/time32.h:13, > from include/linux/time.h:60, > from include/linux/stat.h:19, > from include/linux/module.h:13, > from drivers/iio/accel/adxl367_spi.c:8: > include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] > 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) > | ^~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/mm.h:2888:5: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' > 2888 | #if USE_SPLIT_PTE_PTLOCKS > | ^~~~~~~~~~~~~~~~~~~~~ > include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] > 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) > | ^~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/mm_types_task.h:20:34: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' > 20 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ > | ^~~~~~~~~~~~~~~~~~~~~ > include/linux/mm.h:3010:5: note: in expansion of macro 'USE_SPLIT_PMD_PTLOCKS' > 3010 | #if USE_SPLIT_PMD_PTLOCKS > | ^~~~~~~~~~~~~~~~~~~~~ > drivers/iio/accel/adxl367_spi.c:75:21: error: variable 'adxl367_spi_regmap_bus' has initializer but incomplete type > 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { > | ^~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' > 76 | .read = adxl367_read, > | ^~~~ > drivers/iio/accel/adxl367_spi.c:76:17: warning: excess elements in struct initializer > 76 | .read = adxl367_read, > | ^~~~~~~~~~~~ > drivers/iio/accel/adxl367_spi.c:76:17: note: (near initialization for 'adxl367_spi_regmap_bus') >>> drivers/iio/accel/adxl367_spi.c:77:10: error: 'const struct regmap_bus' has no member named 'write' > 77 | .write = adxl367_write, > | ^~~~~ > drivers/iio/accel/adxl367_spi.c:77:18: warning: excess elements in struct initializer > 77 | .write = adxl367_write, > | ^~~~~~~~~~~~~ > drivers/iio/accel/adxl367_spi.c:77:18: note: (near initialization for 'adxl367_spi_regmap_bus') > drivers/iio/accel/adxl367_spi.c:80:21: error: variable 'adxl367_spi_regmap_config' has initializer but incomplete type > 80 | static const struct regmap_config adxl367_spi_regmap_config = { > | ^~~~~~~~~~~~~ > drivers/iio/accel/adxl367_spi.c:81:10: error: 'const struct regmap_config' has no member named 'reg_bits' > 81 | .reg_bits = 8, > | ^~~~~~~~ > drivers/iio/accel/adxl367_spi.c:81:21: warning: excess elements in struct initializer > 81 | .reg_bits = 8, > | ^ > drivers/iio/accel/adxl367_spi.c:81:21: note: (near initialization for 'adxl367_spi_regmap_config') > drivers/iio/accel/adxl367_spi.c:82:10: error: 'const struct regmap_config' has no member named 'val_bits' > 82 | .val_bits = 8, > | ^~~~~~~~ > drivers/iio/accel/adxl367_spi.c:82:21: warning: excess elements in struct initializer > 82 | .val_bits = 8, > | ^ > drivers/iio/accel/adxl367_spi.c:82:21: note: (near initialization for 'adxl367_spi_regmap_config') > drivers/iio/accel/adxl367_spi.c: In function 'adxl367_spi_probe': > drivers/iio/accel/adxl367_spi.c:132:18: error: implicit declaration of function 'devm_regmap_init' [-Werror=implicit-function-declaration] > 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, > | ^~~~~~~~~~~~~~~~ > drivers/iio/accel/adxl367_spi.c:132:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion] > 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, > | ^ > drivers/iio/accel/adxl367_spi.c: At top level: > drivers/iio/accel/adxl367_spi.c:75:32: error: storage size of 'adxl367_spi_regmap_bus' isn't known > 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { > | ^~~~~~~~~~~~~~~~~~~~~~ > drivers/iio/accel/adxl367_spi.c:80:35: error: storage size of 'adxl367_spi_regmap_config' isn't known > 80 | static const struct regmap_config adxl367_spi_regmap_config = { > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > > > vim +76 drivers/iio/accel/adxl367_spi.c > > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 74 > c922c634bd926d Javier Carrasco 2024-07-03 75 static const struct regmap_bus adxl367_spi_regmap_bus = { > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @76 .read = adxl367_read, > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @77 .write = adxl367_write, > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 78 }; > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 79 > > :::::: The code at line 76 was first introduced by commit > :::::: cbab791c5e2a58c123d84bd9202c054e5449bc96 iio: accel: add ADXL367 driver > > :::::: TO: Cosmin Tanislav <demonsingur@gmail.com> > :::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Strange. I followed the "how to reproduce" guide step by step, but it compiled just fine (gcc-12.3.0 instead of 12.2.0, though). On the other hand, there has been a similar bug in hwmon[1] and it had nothing to do with making the struct const, which actually uncovered a missing select (in that case REGMAP_I2C). In this particular case, 'select REGMAP_SPI' is present in the Kconfig entry for the driver, and the header is included in adxl367_spi.c. The only thing is that the driver uses devm_regmap_init() instead of devm_regmap_init_spi(), and other drivers that include REGMAP_SPI use that one. Does that make sense? Best regards, Javier Carrasco ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' 2024-10-02 7:01 ` Javier Carrasco @ 2024-10-02 7:03 ` Javier Carrasco 2024-10-03 15:13 ` Philip Li 1 sibling, 0 replies; 5+ messages in thread From: Javier Carrasco @ 2024-10-02 7:03 UTC (permalink / raw) To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel, Jonathan Cameron On 02/10/2024 09:01, Javier Carrasco wrote: > On 02/10/2024 05:21, kernel test robot wrote: >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >> head: e32cde8d2bd7d251a8f9b434143977ddf13dcec6 >> commit: c922c634bd926d84967275efbb7275b8645aa343 iio: accel: adxl367: Constify struct regmap_bus >> date: 9 weeks ago >> config: x86_64-randconfig-001-20231120 (https://download.01.org/0day-ci/archive/20241002/202410021111.LknEX9ne-lkp@intel.com/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/20241002/202410021111.LknEX9ne-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/202410021111.LknEX9ne-lkp@intel.com/ >> >> All errors (new ones prefixed by >>): >> >> In file included from include/linux/sched.h:38, >> from include/linux/percpu.h:12, >> from arch/x86/include/asm/msr.h:15, >> from arch/x86/include/asm/tsc.h:10, >> from arch/x86/include/asm/timex.h:6, >> from include/linux/timex.h:67, >> from include/linux/time32.h:13, >> from include/linux/time.h:60, >> from include/linux/stat.h:19, >> from include/linux/module.h:13, >> from drivers/iio/accel/adxl367_spi.c:8: >> include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] >> 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) >> | ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/mm.h:2888:5: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' >> 2888 | #if USE_SPLIT_PTE_PTLOCKS >> | ^~~~~~~~~~~~~~~~~~~~~ >> include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] >> 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) >> | ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/mm_types_task.h:20:34: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' >> 20 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ >> | ^~~~~~~~~~~~~~~~~~~~~ >> include/linux/mm.h:3010:5: note: in expansion of macro 'USE_SPLIT_PMD_PTLOCKS' >> 3010 | #if USE_SPLIT_PMD_PTLOCKS >> | ^~~~~~~~~~~~~~~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:75:21: error: variable 'adxl367_spi_regmap_bus' has initializer but incomplete type >> 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { >> | ^~~~~~~~~~ >>>> drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' >> 76 | .read = adxl367_read, >> | ^~~~ >> drivers/iio/accel/adxl367_spi.c:76:17: warning: excess elements in struct initializer >> 76 | .read = adxl367_read, >> | ^~~~~~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:76:17: note: (near initialization for 'adxl367_spi_regmap_bus') >>>> drivers/iio/accel/adxl367_spi.c:77:10: error: 'const struct regmap_bus' has no member named 'write' >> 77 | .write = adxl367_write, >> | ^~~~~ >> drivers/iio/accel/adxl367_spi.c:77:18: warning: excess elements in struct initializer >> 77 | .write = adxl367_write, >> | ^~~~~~~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:77:18: note: (near initialization for 'adxl367_spi_regmap_bus') >> drivers/iio/accel/adxl367_spi.c:80:21: error: variable 'adxl367_spi_regmap_config' has initializer but incomplete type >> 80 | static const struct regmap_config adxl367_spi_regmap_config = { >> | ^~~~~~~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:81:10: error: 'const struct regmap_config' has no member named 'reg_bits' >> 81 | .reg_bits = 8, >> | ^~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:81:21: warning: excess elements in struct initializer >> 81 | .reg_bits = 8, >> | ^ >> drivers/iio/accel/adxl367_spi.c:81:21: note: (near initialization for 'adxl367_spi_regmap_config') >> drivers/iio/accel/adxl367_spi.c:82:10: error: 'const struct regmap_config' has no member named 'val_bits' >> 82 | .val_bits = 8, >> | ^~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:82:21: warning: excess elements in struct initializer >> 82 | .val_bits = 8, >> | ^ >> drivers/iio/accel/adxl367_spi.c:82:21: note: (near initialization for 'adxl367_spi_regmap_config') >> drivers/iio/accel/adxl367_spi.c: In function 'adxl367_spi_probe': >> drivers/iio/accel/adxl367_spi.c:132:18: error: implicit declaration of function 'devm_regmap_init' [-Werror=implicit-function-declaration] >> 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, >> | ^~~~~~~~~~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:132:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion] >> 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, >> | ^ >> drivers/iio/accel/adxl367_spi.c: At top level: >> drivers/iio/accel/adxl367_spi.c:75:32: error: storage size of 'adxl367_spi_regmap_bus' isn't known >> 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { >> | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/iio/accel/adxl367_spi.c:80:35: error: storage size of 'adxl367_spi_regmap_config' isn't known >> 80 | static const struct regmap_config adxl367_spi_regmap_config = { >> | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> cc1: some warnings being treated as errors >> >> >> vim +76 drivers/iio/accel/adxl367_spi.c >> >> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 74 >> c922c634bd926d Javier Carrasco 2024-07-03 75 static const struct regmap_bus adxl367_spi_regmap_bus = { >> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @76 .read = adxl367_read, >> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @77 .write = adxl367_write, >> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 78 }; >> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 79 >> >> :::::: The code at line 76 was first introduced by commit >> :::::: cbab791c5e2a58c123d84bd9202c054e5449bc96 iio: accel: add ADXL367 driver >> >> :::::: TO: Cosmin Tanislav <demonsingur@gmail.com> >> :::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com> >> > > Strange. I followed the "how to reproduce" guide step by step, but it > compiled just fine (gcc-12.3.0 instead of 12.2.0, though). > > On the other hand, there has been a similar bug in hwmon[1] and it had > nothing to do with making the struct const, which actually uncovered a > missing select (in that case REGMAP_I2C). > > In this particular case, 'select REGMAP_SPI' is present in the Kconfig > entry for the driver, and the header is included in adxl367_spi.c. The > only thing is that the driver uses devm_regmap_init() instead of > devm_regmap_init_spi(), and other drivers that include REGMAP_SPI use > that one. Does that make sense? > > Best regards, > Javier Carrasco Link: https://lore.kernel.org/oe-kbuild-all/202410020246.2cTDDx0X-lkp@intel.com/ [1] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' 2024-10-02 7:01 ` Javier Carrasco 2024-10-02 7:03 ` Javier Carrasco @ 2024-10-03 15:13 ` Philip Li 2024-10-03 16:53 ` Javier Carrasco 1 sibling, 1 reply; 5+ messages in thread From: Philip Li @ 2024-10-03 15:13 UTC (permalink / raw) To: Javier Carrasco Cc: kernel test robot, oe-kbuild-all, linux-kernel, Jonathan Cameron On Wed, Oct 02, 2024 at 09:01:50AM +0200, Javier Carrasco wrote: > On 02/10/2024 05:21, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > head: e32cde8d2bd7d251a8f9b434143977ddf13dcec6 > > commit: c922c634bd926d84967275efbb7275b8645aa343 iio: accel: adxl367: Constify struct regmap_bus > > date: 9 weeks ago > > config: x86_64-randconfig-001-20231120 (https://download.01.org/0day-ci/archive/20241002/202410021111.LknEX9ne-lkp@intel.com/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/20241002/202410021111.LknEX9ne-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/202410021111.LknEX9ne-lkp@intel.com/ > > > > All errors (new ones prefixed by >>): > > > > In file included from include/linux/sched.h:38, > > from include/linux/percpu.h:12, > > from arch/x86/include/asm/msr.h:15, > > from arch/x86/include/asm/tsc.h:10, > > from arch/x86/include/asm/timex.h:6, > > from include/linux/timex.h:67, > > from include/linux/time32.h:13, > > from include/linux/time.h:60, > > from include/linux/stat.h:19, > > from include/linux/module.h:13, > > from drivers/iio/accel/adxl367_spi.c:8: > > include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] > > 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/mm.h:2888:5: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' > > 2888 | #if USE_SPLIT_PTE_PTLOCKS > > | ^~~~~~~~~~~~~~~~~~~~~ > > include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] > > 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/mm_types_task.h:20:34: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' > > 20 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ > > | ^~~~~~~~~~~~~~~~~~~~~ > > include/linux/mm.h:3010:5: note: in expansion of macro 'USE_SPLIT_PMD_PTLOCKS' > > 3010 | #if USE_SPLIT_PMD_PTLOCKS > > | ^~~~~~~~~~~~~~~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:75:21: error: variable 'adxl367_spi_regmap_bus' has initializer but incomplete type > > 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { > > | ^~~~~~~~~~ > >>> drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' > > 76 | .read = adxl367_read, > > | ^~~~ > > drivers/iio/accel/adxl367_spi.c:76:17: warning: excess elements in struct initializer > > 76 | .read = adxl367_read, > > | ^~~~~~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:76:17: note: (near initialization for 'adxl367_spi_regmap_bus') > >>> drivers/iio/accel/adxl367_spi.c:77:10: error: 'const struct regmap_bus' has no member named 'write' > > 77 | .write = adxl367_write, > > | ^~~~~ > > drivers/iio/accel/adxl367_spi.c:77:18: warning: excess elements in struct initializer > > 77 | .write = adxl367_write, > > | ^~~~~~~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:77:18: note: (near initialization for 'adxl367_spi_regmap_bus') > > drivers/iio/accel/adxl367_spi.c:80:21: error: variable 'adxl367_spi_regmap_config' has initializer but incomplete type > > 80 | static const struct regmap_config adxl367_spi_regmap_config = { > > | ^~~~~~~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:81:10: error: 'const struct regmap_config' has no member named 'reg_bits' > > 81 | .reg_bits = 8, > > | ^~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:81:21: warning: excess elements in struct initializer > > 81 | .reg_bits = 8, > > | ^ > > drivers/iio/accel/adxl367_spi.c:81:21: note: (near initialization for 'adxl367_spi_regmap_config') > > drivers/iio/accel/adxl367_spi.c:82:10: error: 'const struct regmap_config' has no member named 'val_bits' > > 82 | .val_bits = 8, > > | ^~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:82:21: warning: excess elements in struct initializer > > 82 | .val_bits = 8, > > | ^ > > drivers/iio/accel/adxl367_spi.c:82:21: note: (near initialization for 'adxl367_spi_regmap_config') > > drivers/iio/accel/adxl367_spi.c: In function 'adxl367_spi_probe': > > drivers/iio/accel/adxl367_spi.c:132:18: error: implicit declaration of function 'devm_regmap_init' [-Werror=implicit-function-declaration] > > 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, > > | ^~~~~~~~~~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:132:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion] > > 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, > > | ^ > > drivers/iio/accel/adxl367_spi.c: At top level: > > drivers/iio/accel/adxl367_spi.c:75:32: error: storage size of 'adxl367_spi_regmap_bus' isn't known > > 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { > > | ^~~~~~~~~~~~~~~~~~~~~~ > > drivers/iio/accel/adxl367_spi.c:80:35: error: storage size of 'adxl367_spi_regmap_config' isn't known > > 80 | static const struct regmap_config adxl367_spi_regmap_config = { > > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > > cc1: some warnings being treated as errors > > > > > > vim +76 drivers/iio/accel/adxl367_spi.c > > > > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 74 > > c922c634bd926d Javier Carrasco 2024-07-03 75 static const struct regmap_bus adxl367_spi_regmap_bus = { > > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @76 .read = adxl367_read, > > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @77 .write = adxl367_write, > > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 78 }; > > cbab791c5e2a58 Cosmin Tanislav 2022-02-14 79 > > > > :::::: The code at line 76 was first introduced by commit > > :::::: cbab791c5e2a58c123d84bd9202c054e5449bc96 iio: accel: add ADXL367 driver > > > > :::::: TO: Cosmin Tanislav <demonsingur@gmail.com> > > :::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > > > Strange. I followed the "how to reproduce" guide step by step, but it > compiled just fine (gcc-12.3.0 instead of 12.2.0, though). Sorry about false report, kindly ignore this. The bot side will look into the detail to resolve the issue asap. > > On the other hand, there has been a similar bug in hwmon[1] and it had > nothing to do with making the struct const, which actually uncovered a > missing select (in that case REGMAP_I2C). > > In this particular case, 'select REGMAP_SPI' is present in the Kconfig > entry for the driver, and the header is included in adxl367_spi.c. The > only thing is that the driver uses devm_regmap_init() instead of > devm_regmap_init_spi(), and other drivers that include REGMAP_SPI use > that one. Does that make sense? > > Best regards, > Javier Carrasco > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' 2024-10-03 15:13 ` Philip Li @ 2024-10-03 16:53 ` Javier Carrasco 0 siblings, 0 replies; 5+ messages in thread From: Javier Carrasco @ 2024-10-03 16:53 UTC (permalink / raw) To: Philip Li Cc: kernel test robot, oe-kbuild-all, linux-kernel, Jonathan Cameron On 03/10/2024 17:13, Philip Li wrote: > On Wed, Oct 02, 2024 at 09:01:50AM +0200, Javier Carrasco wrote: >> On 02/10/2024 05:21, kernel test robot wrote: >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>> head: e32cde8d2bd7d251a8f9b434143977ddf13dcec6 >>> commit: c922c634bd926d84967275efbb7275b8645aa343 iio: accel: adxl367: Constify struct regmap_bus >>> date: 9 weeks ago >>> config: x86_64-randconfig-001-20231120 (https://download.01.org/0day-ci/archive/20241002/202410021111.LknEX9ne-lkp@intel.com/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/20241002/202410021111.LknEX9ne-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/202410021111.LknEX9ne-lkp@intel.com/ >>> >>> All errors (new ones prefixed by >>): >>> >>> In file included from include/linux/sched.h:38, >>> from include/linux/percpu.h:12, >>> from arch/x86/include/asm/msr.h:15, >>> from arch/x86/include/asm/tsc.h:10, >>> from arch/x86/include/asm/timex.h:6, >>> from include/linux/timex.h:67, >>> from include/linux/time32.h:13, >>> from include/linux/time.h:60, >>> from include/linux/stat.h:19, >>> from include/linux/module.h:13, >>> from drivers/iio/accel/adxl367_spi.c:8: >>> include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] >>> 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) >>> | ^~~~~~~~~~~~~~~~~~~~~~~~ >>> include/linux/mm.h:2888:5: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' >>> 2888 | #if USE_SPLIT_PTE_PTLOCKS >>> | ^~~~~~~~~~~~~~~~~~~~~ >>> include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef] >>> 19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) >>> | ^~~~~~~~~~~~~~~~~~~~~~~~ >>> include/linux/mm_types_task.h:20:34: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS' >>> 20 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ >>> | ^~~~~~~~~~~~~~~~~~~~~ >>> include/linux/mm.h:3010:5: note: in expansion of macro 'USE_SPLIT_PMD_PTLOCKS' >>> 3010 | #if USE_SPLIT_PMD_PTLOCKS >>> | ^~~~~~~~~~~~~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:75:21: error: variable 'adxl367_spi_regmap_bus' has initializer but incomplete type >>> 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { >>> | ^~~~~~~~~~ >>>>> drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' >>> 76 | .read = adxl367_read, >>> | ^~~~ >>> drivers/iio/accel/adxl367_spi.c:76:17: warning: excess elements in struct initializer >>> 76 | .read = adxl367_read, >>> | ^~~~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:76:17: note: (near initialization for 'adxl367_spi_regmap_bus') >>>>> drivers/iio/accel/adxl367_spi.c:77:10: error: 'const struct regmap_bus' has no member named 'write' >>> 77 | .write = adxl367_write, >>> | ^~~~~ >>> drivers/iio/accel/adxl367_spi.c:77:18: warning: excess elements in struct initializer >>> 77 | .write = adxl367_write, >>> | ^~~~~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:77:18: note: (near initialization for 'adxl367_spi_regmap_bus') >>> drivers/iio/accel/adxl367_spi.c:80:21: error: variable 'adxl367_spi_regmap_config' has initializer but incomplete type >>> 80 | static const struct regmap_config adxl367_spi_regmap_config = { >>> | ^~~~~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:81:10: error: 'const struct regmap_config' has no member named 'reg_bits' >>> 81 | .reg_bits = 8, >>> | ^~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:81:21: warning: excess elements in struct initializer >>> 81 | .reg_bits = 8, >>> | ^ >>> drivers/iio/accel/adxl367_spi.c:81:21: note: (near initialization for 'adxl367_spi_regmap_config') >>> drivers/iio/accel/adxl367_spi.c:82:10: error: 'const struct regmap_config' has no member named 'val_bits' >>> 82 | .val_bits = 8, >>> | ^~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:82:21: warning: excess elements in struct initializer >>> 82 | .val_bits = 8, >>> | ^ >>> drivers/iio/accel/adxl367_spi.c:82:21: note: (near initialization for 'adxl367_spi_regmap_config') >>> drivers/iio/accel/adxl367_spi.c: In function 'adxl367_spi_probe': >>> drivers/iio/accel/adxl367_spi.c:132:18: error: implicit declaration of function 'devm_regmap_init' [-Werror=implicit-function-declaration] >>> 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, >>> | ^~~~~~~~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:132:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion] >>> 132 | regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, >>> | ^ >>> drivers/iio/accel/adxl367_spi.c: At top level: >>> drivers/iio/accel/adxl367_spi.c:75:32: error: storage size of 'adxl367_spi_regmap_bus' isn't known >>> 75 | static const struct regmap_bus adxl367_spi_regmap_bus = { >>> | ^~~~~~~~~~~~~~~~~~~~~~ >>> drivers/iio/accel/adxl367_spi.c:80:35: error: storage size of 'adxl367_spi_regmap_config' isn't known >>> 80 | static const struct regmap_config adxl367_spi_regmap_config = { >>> | ^~~~~~~~~~~~~~~~~~~~~~~~~ >>> cc1: some warnings being treated as errors >>> >>> >>> vim +76 drivers/iio/accel/adxl367_spi.c >>> >>> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 74 >>> c922c634bd926d Javier Carrasco 2024-07-03 75 static const struct regmap_bus adxl367_spi_regmap_bus = { >>> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @76 .read = adxl367_read, >>> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 @77 .write = adxl367_write, >>> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 78 }; >>> cbab791c5e2a58 Cosmin Tanislav 2022-02-14 79 >>> >>> :::::: The code at line 76 was first introduced by commit >>> :::::: cbab791c5e2a58c123d84bd9202c054e5449bc96 iio: accel: add ADXL367 driver >>> >>> :::::: TO: Cosmin Tanislav <demonsingur@gmail.com> >>> :::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com> >>> >> >> Strange. I followed the "how to reproduce" guide step by step, but it >> compiled just fine (gcc-12.3.0 instead of 12.2.0, though). > > Sorry about false report, kindly ignore this. The bot side will look > into the detail to resolve the issue asap. > No worries. As I already mentioned, the bot has recently found cases where the dependency was indeed missing, I am glad that it found those even if it comes with a couple of false positives, which are easy to verify anyway. Best regards, Javier Carrasco ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-03 16:53 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-02 3:21 drivers/iio/accel/adxl367_spi.c:76:10: error: 'const struct regmap_bus' has no member named 'read' kernel test robot 2024-10-02 7:01 ` Javier Carrasco 2024-10-02 7:03 ` Javier Carrasco 2024-10-03 15:13 ` Philip Li 2024-10-03 16:53 ` Javier Carrasco
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox