2008-01-31 15:49:47

by Alessandro Guido

[permalink] [raw]
Subject: Misc warnings during kernel build

Kconfig:

drivers/net/Kconfig:1743:warning: 'select' used by config symbol 'CPMAC'
refers to undefined symbol 'FIXED_MII_100_FDX'
drivers/spi/Kconfig:156:warning: 'select' used by config symbol 'SPI_PXA2XX'
refers to undefined symbol 'PXA_SSP'


Section mismatches:

WARNING: drivers/ata/built-in.o(.text+0x15b75): Section mismatch in reference
from the function piix_init_one() to the
function .devinit.text:piix_check_450nx_errata()
The function piix_init_one() references
the function __devinit piix_check_450nx_errata().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_check_450nx_errata is wrong.

WARNING: drivers/ata/built-in.o(.text+0x15c11): Section mismatch in reference
from the function piix_init_one() to the
function .devinit.text:piix_init_sata_map()
The function piix_init_one() references
the function __devinit piix_init_sata_map().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_sata_map is wrong.

WARNING: drivers/ata/built-in.o(.text+0x15c7d): Section mismatch in reference
from the function piix_init_one() to the
function .devinit.text:piix_init_pcs()
The function piix_init_one() references
the function __devinit piix_init_pcs().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_pcs is wrong.

WARNING: drivers/ata/built-in.o(.text+0x15c86): Section mismatch in reference
from the function piix_init_one() to the
function .devinit.text:piix_init_sidpr()
The function piix_init_one() references
the function __devinit piix_init_sidpr().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_sidpr is wrong.

WARNING: drivers/pci/built-in.o(.text+0xf3d): Section mismatch in reference
from the function pci_add_new_bus() to the
function .devinit.text:pci_alloc_child_bus()
The function pci_add_new_bus() references
the function __devinit pci_alloc_child_bus().
This is often because pci_add_new_bus lacks a __devinit
annotation or the annotation of pci_alloc_child_bus is wrong.

WARNING: drivers/pci/built-in.o(.text+0x183d): Section mismatch in reference
from the function pci_scan_single_device() to the
function .devinit.text:pci_scan_device()
The function pci_scan_single_device() references
the function __devinit pci_scan_device().
This is often because pci_scan_single_device lacks a __devinit
annotation or the annotation of pci_scan_device is wrong.

WARNING: drivers/pci/built-in.o(.text+0x8992): Section mismatch in reference
from the function pci_bus_size_bridges() to the
function .devinit.text:pci_bus_size_cardbus()
The function pci_bus_size_bridges() references
the function __devinit pci_bus_size_cardbus().
This is often because pci_bus_size_bridges lacks a __devinit
annotation or the annotation of pci_bus_size_cardbus is wrong.

WARNING: drivers/pci/built-in.o(.text+0x8a92): Section mismatch in reference
from the function pci_bus_assign_resources() to the
function .devinit.text:pci_setup_bridge()
The function pci_bus_assign_resources() references
the function __devinit pci_setup_bridge().
This is often because pci_bus_assign_resources lacks a __devinit
annotation or the annotation of pci_setup_bridge is wrong.

WARNING: drivers/pci/built-in.o(__ksymtab+0x60): Section mismatch in reference
from the variable __ksymtab_pci_do_scan_bus to the
function .devinit.text:pci_do_scan_bus()
The symbol pci_do_scan_bus is exported and annotated __devinit
Fix this by removing the __devinit annotation of pci_do_scan_bus or drop the
export.

include/asm/io_32.h: In function ‘memcpy_fromio’:
include/asm/io_32.h:216: warning: passing argument 2 of ‘__memcpy’
discards qualifiers from pointer target type
WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x134): Section mismatch in
reference from the variable pccard_sysfs_interface to the
function .devinit.text:pccard_sysfs_add_socket()
The variable pccard_sysfs_interface references
the function __devinit pccard_sysfs_add_socket()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x138): Section mismatch in
reference from the variable pccard_sysfs_interface to the
function .devexit.text:pccard_sysfs_remove_socket()
The variable pccard_sysfs_interface references
the function __devexit pccard_sysfs_remove_socket()
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,

WARNING: drivers/built-in.o(.text+0xf3d): Section mismatch in reference from
the function pci_add_new_bus() to the
function .devinit.text:pci_alloc_child_bus()
The function pci_add_new_bus() references
the function __devinit pci_alloc_child_bus().
This is often because pci_add_new_bus lacks a __devinit
annotation or the annotation of pci_alloc_child_bus is wrong.

WARNING: drivers/built-in.o(.text+0x183d): Section mismatch in reference from
the function pci_scan_single_device() to the
function .devinit.text:pci_scan_device()
The function pci_scan_single_device() references
the function __devinit pci_scan_device().
This is often because pci_scan_single_device lacks a __devinit
annotation or the annotation of pci_scan_device is wrong.

WARNING: drivers/built-in.o(.text+0x8992): Section mismatch in reference from
the function pci_bus_size_bridges() to the
function .devinit.text:pci_bus_size_cardbus()
The function pci_bus_size_bridges() references
the function __devinit pci_bus_size_cardbus().
This is often because pci_bus_size_bridges lacks a __devinit
annotation or the annotation of pci_bus_size_cardbus is wrong.

WARNING: drivers/built-in.o(.text+0x8a92): Section mismatch in reference from
the function pci_bus_assign_resources() to the
function .devinit.text:pci_setup_bridge()
The function pci_bus_assign_resources() references
the function __devinit pci_setup_bridge().
This is often because pci_bus_assign_resources lacks a __devinit
annotation or the annotation of pci_setup_bridge is wrong.

WARNING: drivers/built-in.o(.text+0x7c725): Section mismatch in reference from
the function piix_init_one() to the
function .devinit.text:piix_check_450nx_errata()
The function piix_init_one() references
the function __devinit piix_check_450nx_errata().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_check_450nx_errata is wrong.

WARNING: drivers/built-in.o(.text+0x7c7c1): Section mismatch in reference from
the function piix_init_one() to the
function .devinit.text:piix_init_sata_map()
The function piix_init_one() references
the function __devinit piix_init_sata_map().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_sata_map is wrong.

WARNING: drivers/built-in.o(.text+0x7c82d): Section mismatch in reference from
the function piix_init_one() to the function .devinit.text:piix_init_pcs()
The function piix_init_one() references
the function __devinit piix_init_pcs().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_pcs is wrong.

WARNING: drivers/built-in.o(.text+0x7c836): Section mismatch in reference from
the function piix_init_one() to the function .devinit.text:piix_init_sidpr()
The function piix_init_one() references
the function __devinit piix_init_sidpr().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_sidpr is wrong.

WARNING: drivers/built-in.o(__ksymtab+0x60): Section mismatch in reference
from the variable __ksymtab_pci_do_scan_bus to the
function .devinit.text:pci_do_scan_bus()
The symbol pci_do_scan_bus is exported and annotated __devinit
Fix this by removing the __devinit annotation of pci_do_scan_bus or drop the
export.

sound/core/init.c: In function ‘snd_card_disconnect’:
sound/core/init.c:307: warning: the address of ‘snd_shutdown_f_ops’ will
always evaluate as ‘true’
WARNING: vmlinux.o(.text+0x6c58): Section mismatch in reference from the
function arch_register_cpu() to the function .devinit.text:register_cpu()
The function arch_register_cpu() references
the function __devinit register_cpu().
This is often because arch_register_cpu lacks a __devinit
annotation or the annotation of register_cpu is wrong.

WARNING: vmlinux.o(.text+0xeca1d): Section mismatch in reference from the
function pci_add_new_bus() to the
function .devinit.text:pci_alloc_child_bus()
The function pci_add_new_bus() references
the function __devinit pci_alloc_child_bus().
This is often because pci_add_new_bus lacks a __devinit
annotation or the annotation of pci_alloc_child_bus is wrong.

WARNING: vmlinux.o(.text+0xed31d): Section mismatch in reference from the
function pci_scan_single_device() to the
function .devinit.text:pci_scan_device()
The function pci_scan_single_device() references
the function __devinit pci_scan_device().
This is often because pci_scan_single_device lacks a __devinit
annotation or the annotation of pci_scan_device is wrong.

WARNING: vmlinux.o(.text+0xed7fc): Section mismatch in reference from the
function pci_scan_child_bus() to the
function .devinit.text:pcibios_fixup_bus()
The function pci_scan_child_bus() references
the function __devinit pcibios_fixup_bus().
This is often because pci_scan_child_bus lacks a __devinit
annotation or the annotation of pcibios_fixup_bus is wrong.

WARNING: vmlinux.o(.text+0xf4472): Section mismatch in reference from the
function pci_bus_size_bridges() to the
function .devinit.text:pci_bus_size_cardbus()
The function pci_bus_size_bridges() references
the function __devinit pci_bus_size_cardbus().
This is often because pci_bus_size_bridges lacks a __devinit
annotation or the annotation of pci_bus_size_cardbus is wrong.

WARNING: vmlinux.o(.text+0xf4572): Section mismatch in reference from the
function pci_bus_assign_resources() to the
function .devinit.text:pci_setup_bridge()
The function pci_bus_assign_resources() references
the function __devinit pci_setup_bridge().
This is often because pci_bus_assign_resources lacks a __devinit
annotation or the annotation of pci_setup_bridge is wrong.

WARNING: vmlinux.o(.text+0x1111ee): Section mismatch in reference from the
function acpi_pci_root_add() to the
function .devinit.text:pci_acpi_scan_root()
The function acpi_pci_root_add() references
the function __devinit pci_acpi_scan_root().
This is often because acpi_pci_root_add lacks a __devinit
annotation or the annotation of pci_acpi_scan_root is wrong.

WARNING: vmlinux.o(.text+0x168205): Section mismatch in reference from the
function piix_init_one() to the
function .devinit.text:piix_check_450nx_errata()
The function piix_init_one() references
the function __devinit piix_check_450nx_errata().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_check_450nx_errata is wrong.

WARNING: vmlinux.o(.text+0x1682a1): Section mismatch in reference from the
function piix_init_one() to the function .devinit.text:piix_init_sata_map()
The function piix_init_one() references
the function __devinit piix_init_sata_map().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_sata_map is wrong.

WARNING: vmlinux.o(.text+0x16830d): Section mismatch in reference from the
function piix_init_one() to the function .devinit.text:piix_init_pcs()
The function piix_init_one() references
the function __devinit piix_init_pcs().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_pcs is wrong.

WARNING: vmlinux.o(.text+0x168316): Section mismatch in reference from the
function piix_init_one() to the function .devinit.text:piix_init_sidpr()
The function piix_init_one() references
the function __devinit piix_init_sidpr().
This is often because piix_init_one lacks a __devinit
annotation or the annotation of piix_init_sidpr is wrong.

WARNING: vmlinux.o(.meminit.text+0x857): Section mismatch in reference from
the function free_area_init_core() to the function .init.text:setup_usemap()
The function __meminit free_area_init_core() references
a function __init setup_usemap().
If free_area_init_core is only used by setup_usemap then
annotate free_area_init_core with a matching annotation.

WARNING: vmlinux.o(__ksymtab+0x24d0): Section mismatch in reference from the
variable __ksymtab_pci_do_scan_bus to the
function .devinit.text:pci_do_scan_bus()
The symbol pci_do_scan_bus is exported and annotated __devinit
Fix this by removing the __devinit annotation of pci_do_scan_bus or drop the
export.

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

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x138): Section mismatch in
reference from the variable pccard_sysfs_interface to the
function .devexit.text:pccard_sysfs_remove_socket()
The variable pccard_sysfs_interface references
the function __devexit pccard_sysfs_remove_socket()
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,

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

WARNING: drivers/pcmcia/rsrc_nonstatic.o(.data+0x44): Section mismatch in
reference from the variable pccard_rsrc_interface to the
function .devexit.text:pccard_sysfs_remove_rsrc()
The variable pccard_rsrc_interface references
the function __devexit pccard_sysfs_remove_rsrc()
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,


Attachments:
(No filename) (14.35 kB)
config.gz (8.71 kB)
Download all attachments

2008-01-31 17:28:25

by Cong Wang

[permalink] [raw]
Subject: [Patch] mm: fix a section mismatch warning


This patch fix this mismatch warning from mm:

WARNING: vmlinux.o(.meminit.text+0x37f): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
modpost: Found 1 section mismatch(es).

Cc: Sam Ravnborg <[email protected]>
Signed-off-by: WANG Cong <[email protected]>

---

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b2838c2..8a9ae3c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3321,7 +3321,7 @@ static inline int pageblock_default_order(unsigned int order)
* - mark all memory queues empty
* - clear the memory bitmaps
*/
-static void __meminit free_area_init_core(struct pglist_data *pgdat,
+static void __init free_area_init_core(struct pglist_data *pgdat,
unsigned long *zones_size, unsigned long *zholes_size)
{
enum zone_type j;
@@ -3445,7 +3445,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
#endif /* CONFIG_FLAT_NODE_MEM_MAP */
}

-void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,
+void __init free_area_init_node(int nid, struct pglist_data *pgdat,
unsigned long *zones_size, unsigned long node_start_pfn,
unsigned long *zholes_size)
{

2008-01-31 18:40:28

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [Patch] mm: fix a section mismatch warning

Hi WANG.

On Fri, Feb 01, 2008 at 01:25:17AM +0800, WANG Cong wrote:
>
> This patch fix this mismatch warning from mm:
>
> WARNING: vmlinux.o(.meminit.text+0x37f): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
> modpost: Found 1 section mismatch(es).
>
> Cc: Sam Ravnborg <[email protected]>
> Signed-off-by: WANG Cong <[email protected]>
>
> ---
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index b2838c2..8a9ae3c 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3321,7 +3321,7 @@ static inline int pageblock_default_order(unsigned int order)
> * - mark all memory queues empty
> * - clear the memory bitmaps
> */
> -static void __meminit free_area_init_core(struct pglist_data *pgdat,
> +static void __init free_area_init_core(struct pglist_data *pgdat,
> unsigned long *zones_size, unsigned long *zholes_size)
> {
> enum zone_type j;
> @@ -3445,7 +3445,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
> #endif /* CONFIG_FLAT_NODE_MEM_MAP */
> }
>
> -void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,
> +void __init free_area_init_node(int nid, struct pglist_data *pgdat,
This change make me a bit unnerved. HAve you checked all callers?
I simple grep shows 46 hits in the tree.

It is always good to explain why the change you do is OK,
for no other reasons than to show you really thought it through.

Sam

2008-02-01 10:33:19

by Cong Wang

[permalink] [raw]
Subject: Re: [Patch] mm: fix a section mismatch warning

On Thu, Jan 31, 2008 at 07:38:53PM +0100, Sam Ravnborg wrote:
>Hi WANG.
>
>On Fri, Feb 01, 2008 at 01:25:17AM +0800, WANG Cong wrote:
>>
>> This patch fix this mismatch warning from mm:
>>
>> WARNING: vmlinux.o(.meminit.text+0x37f): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
>> modpost: Found 1 section mismatch(es).
>>
>> Cc: Sam Ravnborg <[email protected]>
>> Signed-off-by: WANG Cong <[email protected]>
>>
>> ---
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index b2838c2..8a9ae3c 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -3321,7 +3321,7 @@ static inline int pageblock_default_order(unsigned int order)
>> * - mark all memory queues empty
>> * - clear the memory bitmaps
>> */
>> -static void __meminit free_area_init_core(struct pglist_data *pgdat,
>> +static void __init free_area_init_core(struct pglist_data *pgdat,
>> unsigned long *zones_size, unsigned long *zholes_size)
>> {
>> enum zone_type j;
>> @@ -3445,7 +3445,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
>> #endif /* CONFIG_FLAT_NODE_MEM_MAP */
>> }
>>
>> -void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,
>> +void __init free_area_init_node(int nid, struct pglist_data *pgdat,
>This change make me a bit unnerved. HAve you checked all callers?
>I simple grep shows 46 hits in the tree.

I use cscope to do the check. ;)

free_area_init_node is the only caller of free_area_init_core,
but free_area_init_node has more than one callers that didn't
mark __init/__meminit.

>
>It is always good to explain why the change you do is OK,
>for no other reasons than to show you really thought it through.

OK. Thanks.