include/linux/device.h:1350:1: error: type defaults to 'int' in declaration of 'module_init'

From: kbuild test robot
Date: Wed Jan 04 2017 - 05:19:02 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0f64df30124018de92c7f22a044b975da8dd52cc
commit: d47529b2e9fe0ec2eb1f072afad8849f52e385c4 gpio: don't include module.h in shared driver header
date: 4 months ago
config: mips-xway_defconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout d47529b2e9fe0ec2eb1f072afad8849f52e385c4
# save the attached .config to linux build tree
make.cross ARCH=mips

All errors (new ones prefixed by >>):

drivers/mtd/nand/xway_nand.c:235:1: warning: data definition has no type or storage class
MODULE_DEVICE_TABLE(of, xway_nand_match);
^~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
drivers/mtd/nand/xway_nand.c:235:1: warning: parameter names (without types) in function declaration
In file included from include/linux/mtd/mtd.h:26:0,
from include/linux/mtd/nand.h:23,
from drivers/mtd/nand/xway_nand.c:10:
include/linux/device.h:1350:1: warning: data definition has no type or storage class
module_init(__driver##_init); \
^
include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
module_driver(__platform_driver, platform_driver_register, \
^~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
>> include/linux/device.h:1350:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int]
module_init(__driver##_init); \
^
include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
module_driver(__platform_driver, platform_driver_register, \
^~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:6:0,
from include/linux/kernel.h:6,
from include/linux/list.h:8,
from include/linux/wait.h:6,
from include/linux/mtd/nand.h:21,
from drivers/mtd/nand/xway_nand.c:10:
include/linux/export.h:36:30: warning: parameter names (without types) in function declaration
#define THIS_MODULE ((struct module *)0)
^
include/linux/platform_device.h:198:34: note: in expansion of macro 'THIS_MODULE'
__platform_driver_register(drv, THIS_MODULE)
^~~~~~~~~~~
include/linux/device.h:1348:9: note: in expansion of macro 'platform_driver_register'
return __register(&(__driver) , ##__VA_ARGS__); \
^~~~~~~~~~
include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
module_driver(__platform_driver, platform_driver_register, \
^~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/mtd/mtd.h:26:0,
from include/linux/mtd/nand.h:23,
from drivers/mtd/nand/xway_nand.c:10:
include/linux/device.h:1355:1: warning: data definition has no type or storage class
module_exit(__driver##_exit);
^
include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
module_driver(__platform_driver, platform_driver_register, \
^~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
>> include/linux/device.h:1355:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int]
module_exit(__driver##_exit);
^
include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
module_driver(__platform_driver, platform_driver_register, \
^~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:6:0,
from include/linux/kernel.h:6,
from include/linux/list.h:8,
from include/linux/wait.h:6,
from include/linux/mtd/nand.h:21,
from drivers/mtd/nand/xway_nand.c:10:
include/linux/export.h:36:30: warning: parameter names (without types) in function declaration
#define THIS_MODULE ((struct module *)0)
^
include/linux/platform_device.h:198:34: note: in expansion of macro 'THIS_MODULE'
__platform_driver_register(drv, THIS_MODULE)
^~~~~~~~~~~
include/linux/device.h:1348:9: note: in expansion of macro 'platform_driver_register'
return __register(&(__driver) , ##__VA_ARGS__); \
^~~~~~~~~~
include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
module_driver(__platform_driver, platform_driver_register, \
^~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/xway_nand.c:248:16: error: expected declaration specifiers or '...' before string constant
MODULE_LICENSE("GPL");
^~~~~
In file included from include/linux/mtd/mtd.h:26:0,
from include/linux/mtd/nand.h:23,
from drivers/mtd/nand/xway_nand.c:10:
drivers/mtd/nand/xway_nand.c:246:24: warning: 'xway_nand_driver_init' defined but not used [-Wunused-function]
module_platform_driver(xway_nand_driver);
^
include/linux/device.h:1346:19: note: in definition of macro 'module_driver'
static int __init __driver##_init(void) \
^~~~~~~~
drivers/mtd/nand/xway_nand.c:246:1: note: in expansion of macro 'module_platform_driver'
module_platform_driver(xway_nand_driver);
^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +1350 include/linux/device.h

907d0ed1 Lars-Peter Clausen 2011-11-16 1344 */
cd494618 Lars-Peter Clausen 2012-02-25 1345 #define module_driver(__driver, __register, __unregister, ...) \
907d0ed1 Lars-Peter Clausen 2011-11-16 1346 static int __init __driver##_init(void) \
907d0ed1 Lars-Peter Clausen 2011-11-16 1347 { \
cd494618 Lars-Peter Clausen 2012-02-25 1348 return __register(&(__driver) , ##__VA_ARGS__); \
907d0ed1 Lars-Peter Clausen 2011-11-16 1349 } \
907d0ed1 Lars-Peter Clausen 2011-11-16 @1350 module_init(__driver##_init); \
907d0ed1 Lars-Peter Clausen 2011-11-16 1351 static void __exit __driver##_exit(void) \
907d0ed1 Lars-Peter Clausen 2011-11-16 1352 { \
cd494618 Lars-Peter Clausen 2012-02-25 1353 __unregister(&(__driver) , ##__VA_ARGS__); \
907d0ed1 Lars-Peter Clausen 2011-11-16 1354 } \
907d0ed1 Lars-Peter Clausen 2011-11-16 @1355 module_exit(__driver##_exit);
907d0ed1 Lars-Peter Clausen 2011-11-16 1356
f309d444 Paul Gortmaker 2015-05-01 1357 /**
f309d444 Paul Gortmaker 2015-05-01 1358 * builtin_driver() - Helper macro for drivers that don't do anything

:::::: The code at line 1350 was first introduced by commit
:::::: 907d0ed1c84114d4e8dafd66af982515d3739c90 drivercore: Generalize module_platform_driver

:::::: TO: Lars-Peter Clausen <lars@xxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip