All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
@ 2016-12-20 19:16 kbuild test robot
  2016-12-20 21:09 ` Paul Gortmaker
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2016-12-20 19:16 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: kbuild-all, linux-kernel, Linus Walleij

[-- Attachment #1: Type: text/plain, Size: 8326 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e93b1cc8a8965da137ffea0b88e5f62fa1d2a9e6
commit: d47529b2e9fe0ec2eb1f072afad8849f52e385c4 gpio: don't include module.h in shared driver header
date:   3 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 error/warnings (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 +235 drivers/mtd/nand/xway_nand.c

99f2b107 John Crispin   2012-08-23  229  }
99f2b107 John Crispin   2012-08-23  230  
02436675 Hauke Mehrtens 2016-06-20  231  static const struct of_device_id xway_nand_match[] = {
02436675 Hauke Mehrtens 2016-06-20  232  	{ .compatible = "lantiq,nand-xway" },
02436675 Hauke Mehrtens 2016-06-20  233  	{},
02436675 Hauke Mehrtens 2016-06-20  234  };
02436675 Hauke Mehrtens 2016-06-20 @235  MODULE_DEVICE_TABLE(of, xway_nand_match);
02436675 Hauke Mehrtens 2016-06-20  236  
02436675 Hauke Mehrtens 2016-06-20  237  static struct platform_driver xway_nand_driver = {
02436675 Hauke Mehrtens 2016-06-20  238  	.probe	= xway_nand_probe,
02436675 Hauke Mehrtens 2016-06-20  239  	.remove	= xway_nand_remove,
02436675 Hauke Mehrtens 2016-06-20  240  	.driver	= {
02436675 Hauke Mehrtens 2016-06-20  241  		.name		= "lantiq,nand-xway",
02436675 Hauke Mehrtens 2016-06-20  242  		.of_match_table = xway_nand_match,
02436675 Hauke Mehrtens 2016-06-20  243  	},
02436675 Hauke Mehrtens 2016-06-20  244  };
02436675 Hauke Mehrtens 2016-06-20  245  
02436675 Hauke Mehrtens 2016-06-20 @246  module_platform_driver(xway_nand_driver);
02436675 Hauke Mehrtens 2016-06-20  247  
02436675 Hauke Mehrtens 2016-06-20 @248  MODULE_LICENSE("GPL");

:::::: The code at line 235 was first introduced by commit
:::::: 024366750c2e04fdcda8bca685194ef0196b35fe mtd: nand: xway: convert to normal platform driver

:::::: TO: Hauke Mehrtens <hauke@hauke-m.de>
:::::: CC: Boris Brezillon <boris.brezillon@free-electrons.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 15578 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
  2016-12-20 19:16 drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' kbuild test robot
@ 2016-12-20 21:09 ` Paul Gortmaker
  2016-12-20 21:21   ` Paul Gortmaker
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Gortmaker @ 2016-12-20 21:09 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-kernel, Linus Walleij

[drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'] On 21/12/2016 (Wed 03:16) kbuild test robot wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   e93b1cc8a8965da137ffea0b88e5f62fa1d2a9e6
> commit: d47529b2e9fe0ec2eb1f072afad8849f52e385c4 gpio: don't include module.h in shared driver header
> date:   3 months ago
> config: mips-xway_defconfig (attached as .config)

Is this config not in tree?  I don't see it in linux-next:

$ make mips-xway_defconfig
***
*** Can't find default configuration "arch/mips/configs/mips-xway_defconfig"!

> 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 error/warnings (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);

Fix is obvious, even though I'm not sure what config to test it with.
Commit log below explains...

I'll git send-email it separately so the Cc get proper coverage.

Paul.

-----------------------------------------8<------------------------------

 From 8b6672855ef671effcceabdcac8788fd72bd22ca Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Tue, 20 Dec 2016 15:54:16 -0500
Subject: [PATCH] mtd: nand: fix implicit module.h usage in xway_nand.c

In commit d47529b2e9fe0ec2eb1f072afad8849f52e385c4 ("gpio: don't
include module.h in shared driver header") we fixed a bunch of
implicit includes and then did what the shortlog says -- remove
module.h from a gpio header.

In parallel, commit 024366750c2e04fdcda8bca685194ef0196b35fe
("mtd: nand: xway: convert to normal platform driver") added new
modular function calls to a file that now became relying on the
above module.h presence in the gpio header, since it did not
explicitly include module.h header for them as part of the change.

The problem only appears when the two dev streams are merged.

Since the file is tristate, the fix is obvious -- it needs an
explicit include of module.h header.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mtd/nand/xway_nand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
index 1f2948c0c458..00168d633bcf 100644
--- a/drivers/mtd/nand/xway_nand.c
+++ b/drivers/mtd/nand/xway_nand.c
@@ -7,6 +7,7 @@
  *  Copyright © 2016 Hauke Mehrtens <hauke@hauke-m.de>
  */
 
+#include <linux/module.h>
 #include <linux/mtd/nand.h>
 #include <linux/of_gpio.h>
 #include <linux/of_platform.h>
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
  2016-12-20 21:09 ` Paul Gortmaker
@ 2016-12-20 21:21   ` Paul Gortmaker
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2016-12-20 21:21 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-kernel, Linus Walleij

[Re: drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'] On 20/12/2016 (Tue 16:09) Paul Gortmaker wrote:

> [drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'] On 21/12/2016 (Wed 03:16) kbuild test robot wrote:
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   e93b1cc8a8965da137ffea0b88e5f62fa1d2a9e6
> > commit: d47529b2e9fe0ec2eb1f072afad8849f52e385c4 gpio: don't include module.h in shared driver header
> > date:   3 months ago
> > config: mips-xway_defconfig (attached as .config)
> 
> Is this config not in tree?  I don't see it in linux-next:
> 
> $ make mips-xway_defconfig
> ***
> *** Can't find default configuration "arch/mips/configs/mips-xway_defconfig"!
> 

Nevermind ; took me a moment to realize it was using $ARCH-$DEFCONFIG
in the above kbuild test results naming.  I've tested the fix on the
xway_defconfig for ARCH=mips and it works as expected.

Thanks,
Paul.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-20 21:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-20 19:16 drivers/mtd/nand/xway_nand.c:235:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' kbuild test robot
2016-12-20 21:09 ` Paul Gortmaker
2016-12-20 21:21   ` Paul Gortmaker

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.