Patchwork [1/8] net: fix compilation NG when !CONFIG_MODULE

login
register
mail settings
Submitter Andrew Morton
Date Sept. 22, 2008, 9:50 p.m.
Message ID <200809222150.m8MLoZdf031857@imap1.linux-foundation.org>
Download mbox | patch
Permalink /patch/952/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Andrew Morton - Sept. 22, 2008, 9:50 p.m.
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

  CC      net/core/dev.o
net/core/dev.c:1001: error: redefinition of 'dev_load'
include/linux/netdevice.h:1645: error: previous definition of 'dev_load' was here
make[2]: *** [net/core/dev.o] Error 1

dev_load() is not used when CONFIG_MODULE disabled.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 net/core/dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
David Miller - Sept. 23, 2008, 2 a.m.
From: akpm@linux-foundation.org
Date: Mon, 22 Sep 2008 14:50:35 -0700

> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> 
>   CC      net/core/dev.o
> net/core/dev.c:1001: error: redefinition of 'dev_load'
> include/linux/netdevice.h:1645: error: previous definition of 'dev_load' was here
> make[2]: *** [net/core/dev.o] Error 1
> 
> dev_load() is not used when CONFIG_MODULE disabled.
> 
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Andrew, this problem got introduced by a tree other than networking.
Please push this to whatever subsystem tree added that
dev_load dummy decl in include/linux/netdevice.h

I don't see it in any trees I have here.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Morton - Sept. 23, 2008, 4:12 a.m.
On Mon, 22 Sep 2008 19:00:52 -0700 (PDT) David Miller <davem@davemloft.net> wrote:

> From: akpm@linux-foundation.org
> Date: Mon, 22 Sep 2008 14:50:35 -0700
> 
> > From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > 
> >   CC      net/core/dev.o
> > net/core/dev.c:1001: error: redefinition of 'dev_load'
> > include/linux/netdevice.h:1645: error: previous definition of 'dev_load' was here
> > make[2]: *** [net/core/dev.o] Error 1
> > 
> > dev_load() is not used when CONFIG_MODULE disabled.
> > 
> > Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> Andrew, this problem got introduced by a tree other than networking.
> Please push this to whatever subsystem tree added that
> dev_load dummy decl in include/linux/netdevice.h
> 
> I don't see it in any trees I have here.

OK, I don't see the failure either, so I assume that whichever tree
busted things (rusty?) was indepentently fixed.  I'll drop it, thanks.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy.Dunlap - Sept. 23, 2008, 3:47 p.m.
On Mon, 22 Sep 2008, Andrew Morton wrote:

> On Mon, 22 Sep 2008 19:00:52 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
> 
> > From: akpm@linux-foundation.org
> > Date: Mon, 22 Sep 2008 14:50:35 -0700
> > 
> > > From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > > 
> > >   CC      net/core/dev.o
> > > net/core/dev.c:1001: error: redefinition of 'dev_load'
> > > include/linux/netdevice.h:1645: error: previous definition of 'dev_load' was here
> > > make[2]: *** [net/core/dev.o] Error 1
> > > 
> > > dev_load() is not used when CONFIG_MODULE disabled.
> > > 
> > > Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > 
> > Andrew, this problem got introduced by a tree other than networking.
> > Please push this to whatever subsystem tree added that
> > dev_load dummy decl in include/linux/netdevice.h
> > 
> > I don't see it in any trees I have here.
> 
> OK, I don't see the failure either, so I assume that whichever tree
> busted things (rusty?) was indepentently fixed.  I'll drop it, thanks.

You asked Rusty to fix it on 2008-SEP-08 here:
http://marc.info/?l=linux-kernel&m=122091240810285&w=2
and Alexey D.'s patch is here:
http://marc.info/?l=linux-netdev&m=122064308827637&w=2

Patch

diff -puN net/core/dev.c~net-fix-compilation-ng-when-config_module net/core/dev.c
--- a/net/core/dev.c~net-fix-compilation-ng-when-config_module
+++ a/net/core/dev.c
@@ -997,7 +997,7 @@  EXPORT_SYMBOL(netdev_bonding_change);
  *	privileges this function loads the module. If module loading is not
  *	available in this kernel then it becomes a nop.
  */
-
+#ifdef CONFIG_MODULES
 void dev_load(struct net *net, const char *name)
 {
 	struct net_device *dev;
@@ -1009,6 +1009,7 @@  void dev_load(struct net *net, const cha
 	if (!dev && capable(CAP_SYS_MODULE))
 		request_module("%s", name);
 }
+#endif
 
 /**
  *	dev_open	- prepare an interface for use.