From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1469560428856187784==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [mingo-tip:sched/headers 2375/2384] include/linux/device/driver.h:164:1: error: type defaults to 'int' in declaration of 'module_init' Date: Sun, 16 Jan 2022 11:37:59 +0800 Message-ID: <202201160854.9JuTmAwF-lkp@intel.com> List-Id: --===============1469560428856187784== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/h= eaders head: 4c707c1c0de83967079b4e385012fa5b00e2cd11 commit: fbd3e447670c4087ece6324134c77241b9c119b9 [2375/2384] headers/deps: = RDMA: Optimize dependencies, remove inclusi= on config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/2022011= 6/202201160854.9JuTmAwF-lkp(a)intel.com/config) compiler: sparc64-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/com= mit/?id=3Dfbd3e447670c4087ece6324134c77241b9c119b9 git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/= git/mingo/tip.git git fetch --no-tags mingo-tip sched/headers git checkout fbd3e447670c4087ece6324134c77241b9c119b9 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dsparc SHELL=3D/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4460:1: warning: data definit= ion has no type or storage class 4460 | MODULE_DEVICE_TABLE(of, hns_roce_of_match); | ^~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4460:1: error: type defaults = to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=3Dimplicit-int] drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4460:1: warning: parameter na= mes (without types) in function declaration drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4466:1: warning: data definit= ion has no type or storage class 4466 | MODULE_DEVICE_TABLE(acpi, hns_roce_acpi_match); | ^~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4466:1: error: type defaults = to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=3Dimplicit-int] drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4466:1: warning: parameter na= mes (without types) in function declaration In file included from include/linux/device_api.h:34, from drivers/infiniband/hw/hns/hns_roce_hw_v1.c:46: include/linux/device/driver.h:164:1: warning: data definition has no typ= e or storage class 164 | module_init(__driver##_init); \ | ^~~~~~~~~~~ include/linux/platform_device.h:253:9: note: in expansion of macro 'modu= le_driver' 253 | module_driver(__platform_driver, platform_driver_registe= r, \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ >> include/linux/device/driver.h:164:1: error: type defaults to 'int' in de= claration of 'module_init' [-Werror=3Dimplicit-int] 164 | module_init(__driver##_init); \ | ^~~~~~~~~~~ include/linux/platform_device.h:253:9: note: in expansion of macro 'modu= le_driver' 253 | module_driver(__platform_driver, platform_driver_registe= r, \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/linkage.h:7, from include/linux/printk.h:7, from include/asm-generic/bug.h:22, from arch/sparc/include/asm/bug.h:25, from include/linux/bug.h:5, from include/linux/cpumask_types.h:12, from include/linux/cpumask.h:5, from include/linux/smp_api.h:12, from include/linux/lockdep_api.h:27, from include/linux/timer.h:5, from include/linux/workqueue_types.h:9, from include/linux/workqueue_api.h:10, from drivers/infiniband/hw/hns/hns_roce_hw_v1.c:33: include/linux/export.h:19:30: warning: parameter names (without types) i= n function declaration 19 | #define THIS_MODULE ((struct module *)0) | ^~~~~~ include/linux/platform_device.h:223:41: note: in expansion of macro 'THI= S_MODULE' 223 | __platform_driver_register(drv, THIS_MODULE) | ^~~~~~~~~~~ include/linux/device/driver.h:162:16: note: in expansion of macro 'platf= orm_driver_register' 162 | return __register(&(__driver) , ##__VA_ARGS__); \ | ^~~~~~~~~~ include/linux/platform_device.h:253:9: note: in expansion of macro 'modu= le_driver' 253 | module_driver(__platform_driver, platform_driver_registe= r, \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/device_api.h:34, from drivers/infiniband/hw/hns/hns_roce_hw_v1.c:46: include/linux/device/driver.h:169:1: warning: data definition has no typ= e or storage class 169 | module_exit(__driver##_exit); | ^~~~~~~~~~~ include/linux/platform_device.h:253:9: note: in expansion of macro 'modu= le_driver' 253 | module_driver(__platform_driver, platform_driver_registe= r, \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ >> include/linux/device/driver.h:169:1: error: type defaults to 'int' in de= claration of 'module_exit' [-Werror=3Dimplicit-int] 169 | module_exit(__driver##_exit); | ^~~~~~~~~~~ include/linux/platform_device.h:253:9: note: in expansion of macro 'modu= le_driver' 253 | module_driver(__platform_driver, platform_driver_registe= r, \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/linkage.h:7, from include/linux/printk.h:7, from include/asm-generic/bug.h:22, from arch/sparc/include/asm/bug.h:25, from include/linux/bug.h:5, from include/linux/cpumask_types.h:12, from include/linux/cpumask.h:5, from include/linux/smp_api.h:12, from include/linux/lockdep_api.h:27, from include/linux/timer.h:5, from include/linux/workqueue_types.h:9, from include/linux/workqueue_api.h:10, from drivers/infiniband/hw/hns/hns_roce_hw_v1.c:33: include/linux/export.h:19:30: warning: parameter names (without types) i= n function declaration 19 | #define THIS_MODULE ((struct module *)0) | ^~~~~~ include/linux/platform_device.h:223:41: note: in expansion of macro 'THI= S_MODULE' 223 | __platform_driver_register(drv, THIS_MODULE) | ^~~~~~~~~~~ include/linux/device/driver.h:162:16: note: in expansion of macro 'platf= orm_driver_register' 162 | return __register(&(__driver) , ##__VA_ARGS__); \ | ^~~~~~~~~~ include/linux/platform_device.h:253:9: note: in expansion of macro 'modu= le_driver' 253 | module_driver(__platform_driver, platform_driver_registe= r, \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4688:16: error: expected decl= aration specifiers or '...' before string constant 4688 | MODULE_LICENSE("Dual BSD/GPL"); | ^~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4689:15: error: expected decl= aration specifiers or '...' before string constant 4689 | MODULE_AUTHOR("Wei Hu "); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4690:15: error: expected decl= aration specifiers or '...' before string constant 4690 | MODULE_AUTHOR("Nenglong Zhao "); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4691:15: error: expected decl= aration specifiers or '...' before string constant 4691 | MODULE_AUTHOR("Lijun Ou "); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4692:20: error: expected decl= aration specifiers or '...' before string constant 4692 | MODULE_DESCRIPTION("Hisilicon Hip06 Family RoCE Driver"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/device_api.h:34, from drivers/infiniband/hw/hns/hns_roce_hw_v1.c:46: drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:24: warning: 'hns_roce_d= river_init' defined but not used [-Wunused-function] 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~ include/linux/device/driver.h:160:19: note: in definition of macro 'modu= le_driver' 160 | static int __init __driver##_init(void) \ | ^~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v1.c:4686:1: note: in expansion of= macro 'module_platform_driver' 4686 | module_platform_driver(hns_roce_driver); | ^~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +164 include/linux/device/driver.h 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 144 = 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 145 /** 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 146 * module_driver() - Hel= per macro for drivers that don't do anything 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 147 * special in module ini= t/exit. This eliminates a lot of boilerplate. 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 148 * Each module may only = use this macro once, and calling it replaces 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 149 * module_init() and mod= ule_exit(). 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 150 * 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 151 * @__driver: driver name 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 152 * @__register: register= function for this driver type 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 153 * @__unregister: unregi= ster function for this driver type 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 154 * @...: Additional argu= ments to be passed to __register and __unregister. 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 155 * 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 156 * Use this macro to con= struct bus specific macros for registering 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 157 * drivers, and do not u= se it on its own. 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 158 */ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 159 #define module_driver(__= driver, __register, __unregister, ...) \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 160 static int __init __driv= er##_init(void) \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 161 { \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 162 return __register(&(__d= river) , ##__VA_ARGS__); \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 163 } \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 @164 module_init(__driver##_i= nit); \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 165 static void __exit __dri= ver##_exit(void) \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 166 { \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 167 __unregister(&(__driver= ) , ##__VA_ARGS__); \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 168 } \ 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 @169 module_exit(__driver##_e= xit); 4c002c978b7f2f Greg Kroah-Hartman 2019-12-09 170 = :::::: The code at line 164 was first introduced by commit :::::: 4c002c978b7f2f2306d53de051c054504af920a9 device.h: move 'struct driv= er' stuff out to device/driver.h :::::: TO: Greg Kroah-Hartman :::::: CC: Greg Kroah-Hartman --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============1469560428856187784==--