2010-01-13 01:01:38

by Jeff Mahoney

[permalink] [raw]
Subject: [patch 6/6] virtio: fix section mismatch warnings

This patch fixes the following warnings by renaming the driver structures
to be suffixed with _driver.

WARNING: drivers/virtio/virtio_balloon.o(.data+0x88): Section mismatch in reference from the variable virtio_balloon to the function .devexit.text:virtballoon_remove()

WARNING: drivers/char/hw_random/virtio-rng.o(.data+0x88): Section mismatch in reference from the variable virtio_rng to the function .devexit.text:virtrng_remove()

Signed-off-by: Jeff Mahoney <[email protected]>
---
drivers/char/hw_random/virtio-rng.c | 6 +++---
drivers/virtio/virtio_balloon.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -114,7 +114,7 @@ static struct virtio_device_id id_table[
{ 0 },
};

-static struct virtio_driver virtio_rng = {
+static struct virtio_driver virtio_rng_driver = {
.driver.name = KBUILD_MODNAME,
.driver.owner = THIS_MODULE,
.id_table = id_table,
@@ -124,12 +124,12 @@ static struct virtio_driver virtio_rng =

static int __init init(void)
{
- return register_virtio_driver(&virtio_rng);
+ return register_virtio_driver(&virtio_rng_driver);
}

static void __exit fini(void)
{
- unregister_virtio_driver(&virtio_rng);
+ unregister_virtio_driver(&virtio_rng_driver);
}
module_init(init);
module_exit(fini);
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -266,7 +266,7 @@ static void __devexit virtballoon_remove

static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST };

-static struct virtio_driver virtio_balloon = {
+static struct virtio_driver virtio_balloon_driver = {
.feature_table = features,
.feature_table_size = ARRAY_SIZE(features),
.driver.name = KBUILD_MODNAME,
@@ -279,12 +279,12 @@ static struct virtio_driver virtio_ballo

static int __init init(void)
{
- return register_virtio_driver(&virtio_balloon);
+ return register_virtio_driver(&virtio_balloon_driver);
}

static void __exit fini(void)
{
- unregister_virtio_driver(&virtio_balloon);
+ unregister_virtio_driver(&virtio_balloon_driver);
}
module_init(init);
module_exit(fini);


2010-01-13 10:57:34

by Rusty Russell

[permalink] [raw]
Subject: Re: [patch 6/6] virtio: fix section mismatch warnings

On Wed, 13 Jan 2010 11:19:01 am Jeff Mahoney wrote:
> This patch fixes the following warnings by renaming the driver structures
> to be suffixed with _driver.
>
> WARNING: drivers/virtio/virtio_balloon.o(.data+0x88): Section mismatch in reference from the variable virtio_balloon to the function .devexit.text:virtballoon_remove()
>
> WARNING: drivers/char/hw_random/virtio-rng.o(.data+0x88): Section mismatch in reference from the variable virtio_rng to the function .devexit.text:virtrng_remove()
>
> Signed-off-by: Jeff Mahoney <[email protected]>

Acked-by: Rusty Russell <[email protected]>

Andrew, will you take these?

Thanks,
Rusty.

2010-01-14 01:07:54

by Andrew Morton

[permalink] [raw]
Subject: Re: [patch 6/6] virtio: fix section mismatch warnings

On Wed, 13 Jan 2010 21:27:26 +1030
Rusty Russell <[email protected]> wrote:

> On Wed, 13 Jan 2010 11:19:01 am Jeff Mahoney wrote:
> > This patch fixes the following warnings by renaming the driver structures
> > to be suffixed with _driver.
> >
> > WARNING: drivers/virtio/virtio_balloon.o(.data+0x88): Section mismatch in reference from the variable virtio_balloon to the function .devexit.text:virtballoon_remove()
> >
> > WARNING: drivers/char/hw_random/virtio-rng.o(.data+0x88): Section mismatch in reference from the variable virtio_rng to the function .devexit.text:virtrng_remove()
> >
> > Signed-off-by: Jeff Mahoney <[email protected]>
>
> Acked-by: Rusty Russell <[email protected]>
>
> Andrew, will you take these?
>

umm, sure. But I wish I knew how the patch worked. Is there some
magic sauce which moves a variable called foo_driver into a different
section or what?

And if so, what was I doing when that got done :(

2010-01-14 02:02:40

by Jeff Mahoney

[permalink] [raw]
Subject: Re: [patch 6/6] virtio: fix section mismatch warnings

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/13/2010 08:07 PM, Andrew Morton wrote:
> On Wed, 13 Jan 2010 21:27:26 +1030
> Rusty Russell <[email protected]> wrote:
>
>> On Wed, 13 Jan 2010 11:19:01 am Jeff Mahoney wrote:
>>> This patch fixes the following warnings by renaming the driver structures
>>> to be suffixed with _driver.
>>>
>>> WARNING: drivers/virtio/virtio_balloon.o(.data+0x88): Section mismatch in reference from the variable virtio_balloon to the function .devexit.text:virtballoon_remove()
>>>
>>> WARNING: drivers/char/hw_random/virtio-rng.o(.data+0x88): Section mismatch in reference from the variable virtio_rng to the function .devexit.text:virtrng_remove()
>>>
>>> Signed-off-by: Jeff Mahoney <[email protected]>
>>
>> Acked-by: Rusty Russell <[email protected]>
>>
>> Andrew, will you take these?
>>
>
> umm, sure. But I wish I knew how the patch worked. Is there some
> magic sauce which moves a variable called foo_driver into a different
> section or what?
>
> And if so, what was I doing when that got done :(

It doesn't move it into a different section, it just shuts the warning
up. modpost has a whitelist it uses to ignore the mismatch warning.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAktOewsACgkQLPWxlyuTD7IGKgCfSETonDGCsM/AgsUmdGtvSzCi
omQAn3tMc0Ol6PkpaX0Qf6+tvcUnlqcU
=jUja
-----END PGP SIGNATURE-----