All of lore.kernel.org
 help / color / mirror / Atom feed
* virtio-net: new section mismatch warning. revert patch?
@ 2009-11-04 14:17 Michael S. Tsirkin
  2009-11-04 17:25 ` Sam Ravnborg
  2009-11-05  4:40 ` Rusty Russell
  0 siblings, 2 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2009-11-04 14:17 UTC (permalink / raw)
  To: Uwe Kleine-König, Sam Ravnborg
  Cc: David S. Miller, Rusty Russell, Alex Williamson, Mark McLoughlin,
	netdev, linux-kernel

With v2.6.32-rcX I started getting section mismatch warnings for
virtio_net.
make with CONFIG_DEBUG_SECTION_MISMATCH=y shows:

WARNING: drivers/net/virtio_net.o(.data+0x90): Section mismatch in
reference from the variable virtio_net to the function
.devexit.text:virtnet_remove()                                                                    
The variable virtio_net references                                                                            
the function __devexit virtnet_remove()                                                                       
If the reference is valid then annotate the                                                                   
variable with __exit* (see linux/init.h) or name the variable:                                                
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,                                  

virtnet_remove was converted to devexit by this commit:

	commit 3d1285beff2e8467b8c3884d83b7a91a99aa9fcd
	Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
	Date:   Wed Sep 30 22:28:34 2009 +0000

	    move virtnet_remove to .devexit.text

We didn't have these warnings in v2.6.31, so this is a regression.
revert?

-- 
MST

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

* Re: virtio-net: new section mismatch warning. revert patch?
  2009-11-04 14:17 virtio-net: new section mismatch warning. revert patch? Michael S. Tsirkin
@ 2009-11-04 17:25 ` Sam Ravnborg
  2009-11-05  4:40 ` Rusty Russell
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2009-11-04 17:25 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Uwe Kleine-K?nig, David S. Miller, Rusty Russell,
	Alex Williamson, Mark McLoughlin, netdev, linux-kernel

On Wed, Nov 04, 2009 at 04:17:30PM +0200, Michael S. Tsirkin wrote:
> With v2.6.32-rcX I started getting section mismatch warnings for
> virtio_net.
> make with CONFIG_DEBUG_SECTION_MISMATCH=y shows:
> 
> WARNING: drivers/net/virtio_net.o(.data+0x90): Section mismatch in
> reference from the variable virtio_net to the function
> .devexit.text:virtnet_remove()                                                                    
> The variable virtio_net references                                                                            
> the function __devexit virtnet_remove()                                                                       
> If the reference is valid then annotate the                                                                   
> variable with __exit* (see linux/init.h) or name the variable:                                                
> *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,                                  
> 
> virtnet_remove was converted to devexit by this commit:
> 
> 	commit 3d1285beff2e8467b8c3884d83b7a91a99aa9fcd
> 	Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 	Date:   Wed Sep 30 22:28:34 2009 +0000
> 
> 	    move virtnet_remove to .devexit.text
> 
> We didn't have these warnings in v2.6.31, so this is a regression.
> revert?

It is correct to annotate the exit function __devexit.
So we should try to silence modpost in other ways.

Two options:
1) annotate the virtio_net variable with __ref to tell
   it is allowed to reference __init, __exit annotated stuff.
2) Rename virtio_net to virtio_net_driver

This is not a "my machine no longer works" issue but it would
be nice to have it sorted out one way or the other before next -rc.

	Sam

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

* Re: virtio-net: new section mismatch warning. revert patch?
  2009-11-04 14:17 virtio-net: new section mismatch warning. revert patch? Michael S. Tsirkin
  2009-11-04 17:25 ` Sam Ravnborg
@ 2009-11-05  4:40 ` Rusty Russell
  2009-11-05  8:17     ` Uwe Kleine-König
  1 sibling, 1 reply; 6+ messages in thread
From: Rusty Russell @ 2009-11-05  4:40 UTC (permalink / raw)
  To: Michael S. Tsirkin, Greg KH, Sam Ravnborg
  Cc: Uwe Kleine-König, Sam Ravnborg, David S. Miller,
	Alex Williamson, Mark McLoughlin, netdev, linux-kernel

On Thu, 5 Nov 2009 12:47:30 am Michael S. Tsirkin wrote:
> With v2.6.32-rcX I started getting section mismatch warnings for
> virtio_net.
> make with CONFIG_DEBUG_SECTION_MISMATCH=y shows:
> 
> WARNING: drivers/net/virtio_net.o(.data+0x90): Section mismatch in
> reference from the variable virtio_net to the function
> .devexit.text:virtnet_remove()                                                                    
> The variable virtio_net references                                                                            
> the function __devexit virtnet_remove()                                                                       
> If the reference is valid then annotate the                                                                   
> variable with __exit* (see linux/init.h) or name the variable:                                                
> *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,                                  
> 
> virtnet_remove was converted to devexit by this commit:
> 
> 	commit 3d1285beff2e8467b8c3884d83b7a91a99aa9fcd
> 	Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 	Date:   Wed Sep 30 22:28:34 2009 +0000
> 
> 	    move virtnet_remove to .devexit.text
> 
> We didn't have these warnings in v2.6.31, so this is a regression.
> revert?

No, just rename "virtio_net" to "virtio_net_driver".  Meanwhile, ignore it.
It's worked well for me so far.

Uwe: I apologize for accepting your patches.  I will be more careful in
future.

Cheers,
Rusty.

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

* [PATCH] virtio_net: rename driver struct to please modpost
  2009-11-05  4:40 ` Rusty Russell
@ 2009-11-05  8:17     ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2009-11-05  8:17 UTC (permalink / raw)
  To: mst
  Cc: rusty, Sam Ravnborg, David S. Miller, Alex Williamson,
	Mark McLoughlin, netdev, linux-kernel

Commit

	3d1285b (move virtnet_remove to .devexit.text)

introduced the first reference to __devexit in struct virtio_driver
virtio_net which upset modpost ("Section mismatch in reference from the
variable virtio_net to the function .devexit.text:virtnet_remove()").

Fix this by renaming virtio_net to virtio_net_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Blame-taken-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Alex Williamson <alex.williamson@hp.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Cc: netdev@vger.kernel.org
---
Hello,

@Rusty: IMHO there's no need to apologize.  The driver was enhanced by
3d1285b and I consider it OK not to notice the (false) section warning.
(But if you think it was you who took my first patch, then you forgot to
add you S-o-b which is a worse trespass :-)

Best regards
Uwe

 drivers/net/virtio_net.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 05630f2..b9e002f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -998,7 +998,7 @@ static unsigned int features[] = {
 	VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
 };
 
-static struct virtio_driver virtio_net = {
+static struct virtio_driver virtio_net_driver = {
 	.feature_table = features,
 	.feature_table_size = ARRAY_SIZE(features),
 	.driver.name =	KBUILD_MODNAME,
@@ -1011,12 +1011,12 @@ static struct virtio_driver virtio_net = {
 
 static int __init init(void)
 {
-	return register_virtio_driver(&virtio_net);
+	return register_virtio_driver(&virtio_net_driver);
 }
 
 static void __exit fini(void)
 {
-	unregister_virtio_driver(&virtio_net);
+	unregister_virtio_driver(&virtio_net_driver);
 }
 module_init(init);
 module_exit(fini);
-- 
1.6.5.2



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

* [PATCH] virtio_net: rename driver struct to please modpost
@ 2009-11-05  8:17     ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2009-11-05  8:17 UTC (permalink / raw)
  To: mst
  Cc: rusty, Sam Ravnborg, David S. Miller, Alex Williamson,
	Mark McLoughlin, netdev

Commit

	3d1285b (move virtnet_remove to .devexit.text)

introduced the first reference to __devexit in struct virtio_driver
virtio_net which upset modpost ("Section mismatch in reference from the
variable virtio_net to the function .devexit.text:virtnet_remove()").

Fix this by renaming virtio_net to virtio_net_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Blame-taken-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Alex Williamson <alex.williamson@hp.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Cc: netdev@vger.kernel.org
---
Hello,

@Rusty: IMHO there's no need to apologize.  The driver was enhanced by
3d1285b and I consider it OK not to notice the (false) section warning.
(But if you think it was you who took my first patch, then you forgot to
add you S-o-b which is a worse trespass :-)

Best regards
Uwe

 drivers/net/virtio_net.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 05630f2..b9e002f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -998,7 +998,7 @@ static unsigned int features[] = {
 	VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
 };
 
-static struct virtio_driver virtio_net = {
+static struct virtio_driver virtio_net_driver = {
 	.feature_table = features,
 	.feature_table_size = ARRAY_SIZE(features),
 	.driver.name =	KBUILD_MODNAME,
@@ -1011,12 +1011,12 @@ static struct virtio_driver virtio_net = {
 
 static int __init init(void)
 {
-	return register_virtio_driver(&virtio_net);
+	return register_virtio_driver(&virtio_net_driver);
 }
 
 static void __exit fini(void)
 {
-	unregister_virtio_driver(&virtio_net);
+	unregister_virtio_driver(&virtio_net_driver);
 }
 module_init(init);
 module_exit(fini);
-- 
1.6.5.2


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

* Re: [PATCH] virtio_net: rename driver struct to please modpost
  2009-11-05  8:17     ` Uwe Kleine-König
  (?)
@ 2009-11-05  9:32     ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-11-05  9:32 UTC (permalink / raw)
  To: u.kleine-koenig; +Cc: mst, rusty, sam, alex.williamson, markmc, netdev

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu,  5 Nov 2009 09:17:17 +0100

> Commit
> 
> 	3d1285b (move virtnet_remove to .devexit.text)
> 
> introduced the first reference to __devexit in struct virtio_driver
> virtio_net which upset modpost ("Section mismatch in reference from the
> variable virtio_net to the function .devexit.text:virtnet_remove()").
> 
> Fix this by renaming virtio_net to virtio_net_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Reported-by: Michael S. Tsirkin <mst@redhat.com>
> Blame-taken-by: Rusty Russell <rusty@rustcorp.com.au>

Applied, thanks.

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

end of thread, other threads:[~2009-11-05  9:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-04 14:17 virtio-net: new section mismatch warning. revert patch? Michael S. Tsirkin
2009-11-04 17:25 ` Sam Ravnborg
2009-11-05  4:40 ` Rusty Russell
2009-11-05  8:17   ` [PATCH] virtio_net: rename driver struct to please modpost Uwe Kleine-König
2009-11-05  8:17     ` Uwe Kleine-König
2009-11-05  9:32     ` David Miller

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.