Re: [PATCH] misc/cs5535: Fix section mismatch derived fromcs5535_mfgpt_drv variable

From: Sedat Dilek
Date: Mon Jan 03 2011 - 05:04:57 EST


On Mon, Jan 3, 2011 at 10:52 AM, Andres Salomon <dilinger@xxxxxxxxxx> wrote:
> On Mon, Â3 Jan 2011 03:51:28 +0100
> Sedat Dilek <sedat.dilek@xxxxxxxxxxxxxx> wrote:
>
>> From my build.log:
>>
>> WARNING: drivers/misc/cs5535-mfgpt.o(.data+0x0): Section mismatch in
>> reference from the variable cs5535_mfgpt_drv to the
>> function .devinit.text:cs5535_mfgpt_probe() The variable
>> cs5535_mfgpt_drv references the function __devinit
>> cs5535_mfgpt_probe() If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the
>> variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe,
>> *_probe_one, *_console,
>>
>> This patch fixes the warning.
>>
>> Tested with linux-next (next-20101231)
>>
>> Signed-off-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
>> ---
>> Âdrivers/misc/cs5535-mfgpt.c | Â Â2 +-
>> Â1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c
>> index d02d302..d80bd14 100644
>> --- a/drivers/misc/cs5535-mfgpt.c
>> +++ b/drivers/misc/cs5535-mfgpt.c
>> @@ -329,7 +329,7 @@ done:
>> Â Â Â return err;
>> Â}
>>
>> -static struct platform_driver cs5535_mfgpt_drv = {
>> +static struct platform_driver cs5535_mfgpt_drv __refdata = {
>> Â Â Â .driver = {
>> Â Â Â Â Â Â Â .name = DRV_NAME,
>> Â Â Â Â Â Â Â .owner = THIS_MODULE,
>
> Hm, I'm confused. ÂThere are plenty of other drivers in mfd/ and gpio/
> that have their probe/remove functions marked as __dev{init,exit}, with
> their associated platform_driver definitions not marked with any kind
> of init marking. ÂAre they all generating this warning and getting
> the same __refdata treatment?
>

Yes, there is also a section mismatch in "drivers/misc/ioc4.c" (see P.S.).
I hadn't time to look at it as it was very late 3 or 4 a.m. (and first
time sending patches via git-send-email :-)).

There are still some more section mismatches in other sub-trees, for
example "drivers/mtd/devices/sst25l.c" which I haven't catched.
If someone can look at it?

- Sedat -

P.S.: From my build_linux-next_next20101231.dileks.4.log:

WARNING: drivers/misc/ioc4.o(.data+0xc): Section mismatch in reference
from the variable ioc4_load_modules_work to the function
.devinit.text:ioc4_load_modules()
The variable ioc4_load_modules_work references
the function __devinit ioc4_load_modules()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

- EOT -
WARNING: drivers/video/geode/gx1fb.o(.data+0x54): Section mismatch in reference from the variable gx1fb_driver to the function .init.text:gx1fb_probe()
The variable gx1fb_driver references
the function __init gx1fb_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

--
WARNING: drivers/misc/cs5535-mfgpt.o(.data+0x0): Section mismatch in reference from the variable cs5535_mfgpt_drv to the function .devinit.text:cs5535_mfgpt_probe()
The variable cs5535_mfgpt_drv references
the function __devinit cs5535_mfgpt_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: drivers/misc/ioc4.o(.data+0xc): Section mismatch in reference from the variable ioc4_load_modules_work to the function .devinit.text:ioc4_load_modules()
The variable ioc4_load_modules_work references
the function __devinit ioc4_load_modules()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: drivers/mtd/devices/sst25l.o(.devinit.text+0x7f): Section mismatch in reference from the function sst25l_match_device() to the variable .init.data:sst25l_flash_info
The function __devinit sst25l_match_device() references
a variable __initdata sst25l_flash_info.
If sst25l_flash_info is only used by sst25l_match_device then
annotate sst25l_flash_info with a matching annotation.

WARNING: drivers/mtd/devices/sst25l.o(.devinit.text+0x94): Section mismatch in reference from the function sst25l_match_device() to the variable .init.data:sst25l_flash_info
The function __devinit sst25l_match_device() references
a variable __initdata sst25l_flash_info.
If sst25l_flash_info is only used by sst25l_match_device then
annotate sst25l_flash_info with a matching annotation.

WARNING: drivers/mtd/devices/sst25l.o(.devinit.text+0x9e): Section mismatch in reference from the function sst25l_match_device() to the (unknown reference) .init.data:(unknown)
The function __devinit sst25l_match_device() references
a (unknown reference) __initdata (unknown).
If (unknown) is only used by sst25l_match_device then
annotate (unknown) with a matching annotation.

WARNING: drivers/mtd/devices/sst25l.o(.devinit.text+0xa5): Section mismatch in reference from the function sst25l_match_device() to the (unknown reference) .init.data:(unknown)
The function __devinit sst25l_match_device() references
a (unknown reference) __initdata (unknown).
If (unknown) is only used by sst25l_match_device then
annotate (unknown) with a matching annotation.

MKPIGGY arch/x86/boot/compressed/piggy.S
--
WARNING: drivers/net/depca.o(.data+0x0): Section mismatch in reference from the variable depca_isa_driver to the function .init.text:depca_isa_probe()
The variable depca_isa_driver references
the function __init depca_isa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

--
drivers/net/irda/smsc-ircc2.o(.data+0x18): Section mismatch in reference from the variable smsc_ircc_pnp_driver to the function .init.text:smsc_ircc_pnp_probe()
The variable smsc_ircc_pnp_driver references
the function __init smsc_ircc_pnp_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

--
WARNING: drivers/net/ksz884x.o(.data+0x18): Section mismatch in reference from the variable pci_device_driver to the function .init.text:pcidev_init()
The variable pci_device_driver references
the function __init pcidev_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: drivers/video/geode/gx1fb.o(.data+0x54): Section mismatch in reference from the variable gx1fb_driver to the function .init.text:gx1fb_probe()
The variable gx1fb_driver references
the function __init gx1fb_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,