Hi Zhang, kernel test robot noticed the following build warnings: [auto build test WARNING on next-20231103] url: https://github.com/intel-lab-lkp/linux/commits/Zhang-Xiaoxu/spi-mockup-Add-SPI-controller-testing-driver/20231104-144859 base: next-20231103 patch link: https://lore.kernel.org/r/20231104064650.972687-5-zhangxiaoxu%40huaweicloud.com patch subject: [PATCH v3 -next 4/5] spi: mockup: Add speed and flags attribute support config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231104/202311041823.CPs0Ymwh-lkp@xxxxxxxxx/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231104/202311041823.CPs0Ymwh-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202311041823.CPs0Ymwh-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): drivers/spi/spi-mockup.c:339:1: error: expected ',' or ';' before 'static' 339 | static ssize_t spi_mockup_ ## name ## _store(struct config_item *item, \ | ^~~~~~ drivers/spi/spi-mockup.c:364:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 364 | SPI_MOCKUP_ATTR(u32, max_speed) | ^~~~~~~~~~~~~~~ In file included from drivers/spi/spi-mockup.c:15: drivers/spi/spi-mockup.c:361:18: error: 'spi_mockup_max_speed_store' undeclared here (not in a function); did you mean 'spi_mockup_min_speed_store'? 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:145:27: note: in definition of macro 'CONFIGFS_ATTR_WO' 145 | .store = _pfx##_name##_store, \ | ^~~~ drivers/spi/spi-mockup.c:364:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 364 | SPI_MOCKUP_ATTR(u32, max_speed) | ^~~~~~~~~~~~~~~ drivers/spi/spi-mockup.c:339:1: error: expected ',' or ';' before 'static' 339 | static ssize_t spi_mockup_ ## name ## _store(struct config_item *item, \ | ^~~~~~ drivers/spi/spi-mockup.c:365:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 365 | SPI_MOCKUP_ATTR(u16, flags) | ^~~~~~~~~~~~~~~ drivers/spi/spi-mockup.c:361:18: error: 'spi_mockup_flags_store' undeclared here (not in a function); did you mean 'spi_mockup_enable_store'? 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:145:27: note: in definition of macro 'CONFIGFS_ATTR_WO' 145 | .store = _pfx##_name##_store, \ | ^~~~ drivers/spi/spi-mockup.c:365:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 365 | SPI_MOCKUP_ATTR(u16, flags) | ^~~~~~~~~~~~~~~ drivers/spi/spi-mockup.c:339:1: error: expected ',' or ';' before 'static' 339 | static ssize_t spi_mockup_ ## name ## _store(struct config_item *item, \ | ^~~~~~ drivers/spi/spi-mockup.c:366:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 366 | SPI_MOCKUP_ATTR(u16, num_cs) | ^~~~~~~~~~~~~~~ drivers/spi/spi-mockup.c:361:18: error: 'spi_mockup_num_cs_store' undeclared here (not in a function); did you mean 'spi_mockup_enable_store'? 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:145:27: note: in definition of macro 'CONFIGFS_ATTR_WO' 145 | .store = _pfx##_name##_store, \ | ^~~~ drivers/spi/spi-mockup.c:366:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 366 | SPI_MOCKUP_ATTR(u16, num_cs) | ^~~~~~~~~~~~~~~ drivers/spi/spi-mockup.c:368:1: error: expected ',' or ';' before 'static' 368 | static struct configfs_attribute *spi_mockup_configfs_attrs[] = { | ^~~~~~ drivers/spi/spi-mockup.c:380:27: error: 'spi_mockup_configfs_attrs' undeclared here (not in a function); did you mean 'spi_mockup_attrs'? 380 | .ct_attrs = spi_mockup_configfs_attrs, | ^~~~~~~~~~~~~~~~~~~~~~~~~ | spi_mockup_attrs >> drivers/spi/spi-mockup.c:361:18: warning: 'spi_mockup_attr_num_cs' defined but not used [-Wunused-variable] 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:141:34: note: in definition of macro 'CONFIGFS_ATTR_WO' 141 | static struct configfs_attribute _pfx##attr_##_name = { \ | ^~~~ drivers/spi/spi-mockup.c:366:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 366 | SPI_MOCKUP_ATTR(u16, num_cs) | ^~~~~~~~~~~~~~~ >> drivers/spi/spi-mockup.c:361:18: warning: 'spi_mockup_attr_flags' defined but not used [-Wunused-variable] 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:141:34: note: in definition of macro 'CONFIGFS_ATTR_WO' 141 | static struct configfs_attribute _pfx##attr_##_name = { \ | ^~~~ drivers/spi/spi-mockup.c:365:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 365 | SPI_MOCKUP_ATTR(u16, flags) | ^~~~~~~~~~~~~~~ >> drivers/spi/spi-mockup.c:361:18: warning: 'spi_mockup_attr_max_speed' defined but not used [-Wunused-variable] 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:141:34: note: in definition of macro 'CONFIGFS_ATTR_WO' 141 | static struct configfs_attribute _pfx##attr_##_name = { \ | ^~~~ drivers/spi/spi-mockup.c:364:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 364 | SPI_MOCKUP_ATTR(u32, max_speed) | ^~~~~~~~~~~~~~~ >> drivers/spi/spi-mockup.c:361:18: warning: 'spi_mockup_attr_min_speed' defined but not used [-Wunused-variable] 361 | CONFIGFS_ATTR_WO(spi_mockup_, name) \ | ^~~~~~~~~~~ include/linux/configfs.h:141:34: note: in definition of macro 'CONFIGFS_ATTR_WO' 141 | static struct configfs_attribute _pfx##attr_##_name = { \ | ^~~~ drivers/spi/spi-mockup.c:363:1: note: in expansion of macro 'SPI_MOCKUP_ATTR' 363 | SPI_MOCKUP_ATTR(u32, min_speed) | ^~~~~~~~~~~~~~~ >> drivers/spi/spi-mockup.c:336:18: warning: 'spi_mockup_attr_disable' defined but not used [-Wunused-variable] 336 | CONFIGFS_ATTR_WO(spi_mockup_, disable); | ^~~~~~~~~~~ include/linux/configfs.h:141:34: note: in definition of macro 'CONFIGFS_ATTR_WO' 141 | static struct configfs_attribute _pfx##attr_##_name = { \ | ^~~~ >> drivers/spi/spi-mockup.c:316:18: warning: 'spi_mockup_attr_enable' defined but not used [-Wunused-variable] 316 | CONFIGFS_ATTR_WO(spi_mockup_, enable); | ^~~~~~~~~~~ include/linux/configfs.h:141:34: note: in definition of macro 'CONFIGFS_ATTR_WO' 141 | static struct configfs_attribute _pfx##attr_##_name = { \ | ^~~~ Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for BPF_EVENTS Depends on [n]: FTRACE [=n] && BPF_SYSCALL [=y] && (KPROBE_EVENTS [=n] || UPROBE_EVENTS [=n]) && PERF_EVENTS [=n] Selected by [y]: - SPI_MOCKUP [=y] && SPI [=y] && SPI_MASTER [=y] && OF [=y] vim +/spi_mockup_attr_num_cs +361 drivers/spi/spi-mockup.c 287 288 static ssize_t 289 spi_mockup_enable_store(struct config_item *item, const char *page, size_t len) 290 { 291 int ret = len; 292 struct platform_device_info pdevinfo = {0}; 293 struct spi_mockup_device *dev = to_spi_mockup_dev(item); 294 295 mutex_lock(&dev->lock); 296 if (dev->pdev) { 297 ret = -EEXIST; 298 goto out; 299 } 300 301 pdevinfo.name = "spi-mockup"; 302 pdevinfo.id = dev->bus_nr; 303 pdevinfo.data = &dev->data; 304 pdevinfo.size_data = sizeof(dev->data); 305 306 dev->pdev = platform_device_register_full(&pdevinfo); 307 if (IS_ERR(dev->pdev)) { 308 ret = PTR_ERR(dev->pdev); 309 dev->pdev = NULL; 310 goto out; 311 } 312 out: 313 mutex_unlock(&dev->lock); 314 return ret; 315 } > 316 CONFIGFS_ATTR_WO(spi_mockup_, enable); 317 318 static ssize_t 319 spi_mockup_disable_store(struct config_item *item, const char *page, size_t len) 320 { 321 int ret = len; 322 struct spi_mockup_device *dev = to_spi_mockup_dev(item); 323 324 mutex_lock(&dev->lock); 325 if (!dev->pdev) { 326 ret = -ENODEV; 327 goto out; 328 } 329 330 platform_device_unregister(dev->pdev); 331 dev->pdev = NULL; 332 out: 333 mutex_unlock(&dev->lock); 334 return ret; 335 } > 336 CONFIGFS_ATTR_WO(spi_mockup_, disable); 337 338 #define SPI_MOCKUP_ATTR(type, name) \ 339 static ssize_t spi_mockup_ ## name ## _store(struct config_item *item, \ 340 const char *page, size_t len) \ 341 { \ 342 int ret; \ 343 type val; \ 344 struct spi_mockup_device *dev = to_spi_mockup_dev(item); \ 345 \ 346 mutex_lock(&dev->lock); \ 347 if (dev->pdev) { \ 348 ret = -EBUSY; \ 349 goto out; \ 350 } \ 351 \ 352 ret = kstrto ## type(page, 0, &val); \ 353 if (ret) \ 354 goto out; \ 355 \ 356 dev->data.name = val; \ 357 out: \ 358 mutex_unlock(&dev->lock); \ 359 return ret ? ret : len; \ 360 } \ > 361 CONFIGFS_ATTR_WO(spi_mockup_, name) \ 362 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki