A section mismatch warning

Woody Wu narkewoody at gmail.com
Thu Aug 15 12:50:17 EDT 2013


Hi,

In my irq.c, there are a piece of code:

static int __init s3c2416_irq_add(struct sys_device *sysdev)
{
    printk(KERN_INFO "S3C2416: IRQ Support\n");

    s3c2416_add_sub(IRQ_LCD, s3c2416_irq_demux_lcd, &s3c2416_irq_lcd,
            IRQ_S3C2443_LCD2, IRQ_S3C2443_LCD4);

    s3c2416_add_sub(IRQ_S3C2443_DMA, s3c2416_irq_demux_dma,
            &s3c2416_irq_dma, IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5);

    s3c2416_add_sub(IRQ_S3C2443_UART3, s3c2416_irq_demux_uart3,
            &s3c2416_irq_uart3,
            IRQ_S3C2443_RX3, IRQ_S3C2443_ERR3);

    s3c2416_add_sub(IRQ_WDT, s3c2416_irq_demux_wdtac97,
            &s3c2416_irq_wdtac97,
            IRQ_S3C2443_WDT, IRQ_S3C2443_AC97);

    return 0;
}

static struct sysdev_driver s3c2416_irq_driver = {
    .add        = s3c2416_irq_add,
};

it triggers a warning:

WARNING: vmlinux.o(.data+0x15a0): Section mismatch in reference from the
variable s3c2416_irq_driver to the function .init.text:s3c2416_irq_add()
The variable s3c2416_irq_driver references
the function __init s3c2416_irq_add()
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

But after I changed the variable definition to:
static struct sysdev_driver __init s3c2416_irq_driver = {
    .add        = s3c2416_irq_add,
};
I then got a compile time error:
arch/arm/mach-s3c2416/irq.c:237:15: warning: '__cold__' attribute ignored
[-Wattributes]
arch/arm/mach-s3c2416/irq.c:237:36: error: 'no_instrument_function'
attribute applies only to functions

So I don't know how to fix the warning correctly.  Could anyone please
help? Thanks in advance.


-- 
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody at gmail.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130816/e841af59/attachment.html 


More information about the Kernelnewbies mailing list