All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-13  3:27 ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-13  3:27 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
  Cc: linux-next, linux-kernel, Yinghai Lu, Benjamin Herrenschmidt, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 2636 bytes --]

Hi all,

After merging the scsi-post-merge tree, today's linux-next build (powerpc
allnoconfig, i386 defconfig and others) produced these warnings (I build
with CONFIG_DEBUG_SECTION_MISMATCH=y):

WARNING: mm/built-in.o(.text+0x25910): Section mismatch in reference from the function memblock_find_in_range() to the function .init.text:memblock_find_base()
The function memblock_find_in_range() references
the function __init memblock_find_base().
This is often because memblock_find_in_range lacks a __init 
annotation or the annotation of memblock_find_base is wrong.

WARNING: mm/built-in.o(.text+0x25bfc): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
The function memblock_double_array() references
the function __init memblock_free().
This is often because memblock_double_array lacks a __init 
annotation or the annotation of memblock_free is wrong.

WARNING: mm/built-in.o(.text+0x25c5c): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_find_base()
The function memblock_double_array() references
the function __init memblock_find_base().
This is often because memblock_double_array lacks a __init 
annotation or the annotation of memblock_find_base is wrong.

WARNING: mm/built-in.o(.text+0x26194): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
The function memblock_reserve_reserved_regions() references
the function __init memblock_reserve().
This is often because memblock_reserve_reserved_regions lacks a __init 
annotation or the annotation of memblock_reserve is wrong.

WARNING: mm/built-in.o(.text+0x2630c): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
The function memblock_free_reserved_regions() references
the function __init memblock_free().
This is often because memblock_free_reserved_regions lacks a __init 
annotation or the annotation of memblock_free is wrong.

WARNING: vmlinux.o(.text+0x10190): Section mismatch in reference from the function setup_initial_memory_limit() to the function .init.text:memblock_set_current_limit()
The function setup_initial_memory_limit() references
the function __init memblock_set_current_limit().
This is often because setup_initial_memory_limit lacks a __init 
annotation or the annotation of memblock_set_current_limit is wrong.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-13  3:27 ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-13  3:27 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
  Cc: linux-next, Yinghai Lu, linux-kernel, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 2636 bytes --]

Hi all,

After merging the scsi-post-merge tree, today's linux-next build (powerpc
allnoconfig, i386 defconfig and others) produced these warnings (I build
with CONFIG_DEBUG_SECTION_MISMATCH=y):

WARNING: mm/built-in.o(.text+0x25910): Section mismatch in reference from the function memblock_find_in_range() to the function .init.text:memblock_find_base()
The function memblock_find_in_range() references
the function __init memblock_find_base().
This is often because memblock_find_in_range lacks a __init 
annotation or the annotation of memblock_find_base is wrong.

WARNING: mm/built-in.o(.text+0x25bfc): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
The function memblock_double_array() references
the function __init memblock_free().
This is often because memblock_double_array lacks a __init 
annotation or the annotation of memblock_free is wrong.

WARNING: mm/built-in.o(.text+0x25c5c): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_find_base()
The function memblock_double_array() references
the function __init memblock_find_base().
This is often because memblock_double_array lacks a __init 
annotation or the annotation of memblock_find_base is wrong.

WARNING: mm/built-in.o(.text+0x26194): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
The function memblock_reserve_reserved_regions() references
the function __init memblock_reserve().
This is often because memblock_reserve_reserved_regions lacks a __init 
annotation or the annotation of memblock_reserve is wrong.

WARNING: mm/built-in.o(.text+0x2630c): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
The function memblock_free_reserved_regions() references
the function __init memblock_free().
This is often because memblock_free_reserved_regions lacks a __init 
annotation or the annotation of memblock_free is wrong.

WARNING: vmlinux.o(.text+0x10190): Section mismatch in reference from the function setup_initial_memory_limit() to the function .init.text:memblock_set_current_limit()
The function setup_initial_memory_limit() references
the function __init memblock_set_current_limit().
This is often because setup_initial_memory_limit lacks a __init 
annotation or the annotation of memblock_set_current_limit is wrong.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-13  3:27 ` Stephen Rothwell
@ 2010-09-13  4:14   ` Yinghai Lu
  -1 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-13  4:14 UTC (permalink / raw)
  To: Stephen Rothwell, Ingo Molnar
  Cc: Thomas Gleixner, H. Peter Anvin, Peter Zijlstra, linux-next,
	linux-kernel, Benjamin Herrenschmidt, ppc-dev

On 09/12/2010 08:27 PM, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the scsi-post-merge tree, today's linux-next build (powerpc
> allnoconfig, i386 defconfig and others) produced these warnings (I build
> with CONFIG_DEBUG_SECTION_MISMATCH=y):
> 
> WARNING: mm/built-in.o(.text+0x25910): Section mismatch in reference from the function memblock_find_in_range() to the function .init.text:memblock_find_base()
> The function memblock_find_in_range() references
> the function __init memblock_find_base().
> This is often because memblock_find_in_range lacks a __init 
> annotation or the annotation of memblock_find_base is wrong.

please check it, and it should get into core/memblock branch.

Thanks

Yinghai

[PATCH] memblock: Fix section mismatch warning

for arches that use memblock other than x86

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 mm/memblock.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-13  4:14   ` Yinghai Lu
  0 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-13  4:14 UTC (permalink / raw)
  To: Stephen Rothwell, Ingo Molnar
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Thomas Gleixner, ppc-dev

On 09/12/2010 08:27 PM, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the scsi-post-merge tree, today's linux-next build (powerpc
> allnoconfig, i386 defconfig and others) produced these warnings (I build
> with CONFIG_DEBUG_SECTION_MISMATCH=y):
> 
> WARNING: mm/built-in.o(.text+0x25910): Section mismatch in reference from the function memblock_find_in_range() to the function .init.text:memblock_find_base()
> The function memblock_find_in_range() references
> the function __init memblock_find_base().
> This is often because memblock_find_in_range lacks a __init 
> annotation or the annotation of memblock_find_base is wrong.

please check it, and it should get into core/memblock branch.

Thanks

Yinghai

[PATCH] memblock: Fix section mismatch warning

for arches that use memblock other than x86

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 mm/memblock.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-13  4:14   ` Yinghai Lu
@ 2010-09-13  4:39     ` Stephen Rothwell
  -1 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-13  4:39 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 2514 bytes --]

Hi Yinghai,

On Sun, 12 Sep 2010 21:14:15 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> please check it, and it should get into core/memblock branch.
> 
> Thanks
> 
> Yinghai
> 
> [PATCH] memblock: Fix section mismatch warning
> 
> for arches that use memblock other than x86
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

Your patch fixes some of the warnings, but still leaves these for a
powerpc allnoconfig build:

WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
The function memblock_double_array() references
the function __init memblock_free().
This is often because memblock_double_array lacks a __init 
annotation or the annotation of memblock_free is wrong.

WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
The function memblock_reserve_reserved_regions() references
the function __init memblock_reserve().
This is often because memblock_reserve_reserved_regions lacks a __init 
annotation or the annotation of memblock_reserve is wrong.

WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
The function memblock_free_reserved_regions() references
the function __init memblock_free().
This is often because memblock_free_reserved_regions lacks a __init 
annotation or the annotation of memblock_free is wrong.

And these for a i386 defconfig build:

WARNING: mm/built-in.o(.text+0x1e261): Section mismatch in reference from the function memblock_is_memory() to the variable .init.data:memblock
The function memblock_is_memory() references
the variable __initdata memblock.
This is often because memblock_is_memory lacks a __initdata 
annotation or the annotation of memblock is wrong.

WARNING: mm/built-in.o(.text+0x1e27f): Section mismatch in reference from the function memblock_is_region_memory() to the variable .init.data:memblock
The function memblock_is_region_memory() references
the variable __initdata memblock.
This is often because memblock_is_region_memory lacks a __initdata 
annotation or the annotation of memblock is wrong.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-13  4:39     ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-13  4:39 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 2514 bytes --]

Hi Yinghai,

On Sun, 12 Sep 2010 21:14:15 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> please check it, and it should get into core/memblock branch.
> 
> Thanks
> 
> Yinghai
> 
> [PATCH] memblock: Fix section mismatch warning
> 
> for arches that use memblock other than x86
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

Your patch fixes some of the warnings, but still leaves these for a
powerpc allnoconfig build:

WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
The function memblock_double_array() references
the function __init memblock_free().
This is often because memblock_double_array lacks a __init 
annotation or the annotation of memblock_free is wrong.

WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
The function memblock_reserve_reserved_regions() references
the function __init memblock_reserve().
This is often because memblock_reserve_reserved_regions lacks a __init 
annotation or the annotation of memblock_reserve is wrong.

WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
The function memblock_free_reserved_regions() references
the function __init memblock_free().
This is often because memblock_free_reserved_regions lacks a __init 
annotation or the annotation of memblock_free is wrong.

And these for a i386 defconfig build:

WARNING: mm/built-in.o(.text+0x1e261): Section mismatch in reference from the function memblock_is_memory() to the variable .init.data:memblock
The function memblock_is_memory() references
the variable __initdata memblock.
This is often because memblock_is_memory lacks a __initdata 
annotation or the annotation of memblock is wrong.

WARNING: mm/built-in.o(.text+0x1e27f): Section mismatch in reference from the function memblock_is_region_memory() to the variable .init.data:memblock
The function memblock_is_region_memory() references
the variable __initdata memblock.
This is often because memblock_is_region_memory lacks a __initdata 
annotation or the annotation of memblock is wrong.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-13  4:39     ` Stephen Rothwell
@ 2010-09-13  8:24       ` Yinghai Lu
  -1 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-13  8:24 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

On 09/12/2010 09:39 PM, Stephen Rothwell wrote:

> 
> Your patch fixes some of the warnings, but still leaves these for a
> powerpc allnoconfig build:
> 
> WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
> The function memblock_double_array() references
> the function __init memblock_free().
> This is often because memblock_double_array lacks a __init 
> annotation or the annotation of memblock_free is wrong.
> 
> WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
> The function memblock_reserve_reserved_regions() references
> the function __init memblock_reserve().
> This is often because memblock_reserve_reserved_regions lacks a __init 
> annotation or the annotation of memblock_reserve is wrong.
> 
> WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
> The function memblock_free_reserved_regions() references
> the function __init memblock_free().
> This is often because memblock_free_reserved_regions lacks a __init 
> annotation or the annotation of memblock_free is wrong.

v1 already changed them all to __init_memblock, so we should not have those warnings.

> 
> And these for a i386 defconfig build:
> 
> WARNING: mm/built-in.o(.text+0x1e261): Section mismatch in reference from the function memblock_is_memory() to the variable .init.data:memblock
> The function memblock_is_memory() references
> the variable __initdata memblock.
> This is often because memblock_is_memory lacks a __initdata 
> annotation or the annotation of memblock is wrong.
> 
> WARNING: mm/built-in.o(.text+0x1e27f): Section mismatch in reference from the function memblock_is_region_memory() to the variable .init.data:memblock
> The function memblock_is_region_memory() references
> the variable __initdata memblock.
> This is often because memblock_is_region_memory lacks a __initdata 
> annotation or the annotation of memblock is wrong.
> 

you must have old gcc, those functions are not used with i386.

[PATCH -v2] memblock: Fix section mismatch warning

for arches that use memblock other than x86

-v2: more with memblock_is_meory()

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 mm/memblock.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_add
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-13  8:24       ` Yinghai Lu
  0 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-13  8:24 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

On 09/12/2010 09:39 PM, Stephen Rothwell wrote:

> 
> Your patch fixes some of the warnings, but still leaves these for a
> powerpc allnoconfig build:
> 
> WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
> The function memblock_double_array() references
> the function __init memblock_free().
> This is often because memblock_double_array lacks a __init 
> annotation or the annotation of memblock_free is wrong.
> 
> WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
> The function memblock_reserve_reserved_regions() references
> the function __init memblock_reserve().
> This is often because memblock_reserve_reserved_regions lacks a __init 
> annotation or the annotation of memblock_reserve is wrong.
> 
> WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
> The function memblock_free_reserved_regions() references
> the function __init memblock_free().
> This is often because memblock_free_reserved_regions lacks a __init 
> annotation or the annotation of memblock_free is wrong.

v1 already changed them all to __init_memblock, so we should not have those warnings.

> 
> And these for a i386 defconfig build:
> 
> WARNING: mm/built-in.o(.text+0x1e261): Section mismatch in reference from the function memblock_is_memory() to the variable .init.data:memblock
> The function memblock_is_memory() references
> the variable __initdata memblock.
> This is often because memblock_is_memory lacks a __initdata 
> annotation or the annotation of memblock is wrong.
> 
> WARNING: mm/built-in.o(.text+0x1e27f): Section mismatch in reference from the function memblock_is_region_memory() to the variable .init.data:memblock
> The function memblock_is_region_memory() references
> the variable __initdata memblock.
> This is often because memblock_is_region_memory lacks a __initdata 
> annotation or the annotation of memblock is wrong.
> 

you must have old gcc, those functions are not used with i386.

[PATCH -v2] memblock: Fix section mismatch warning

for arches that use memblock other than x86

-v2: more with memblock_is_meory()

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 mm/memblock.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_add
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-13  8:24       ` Yinghai Lu
@ 2010-09-14  4:50         ` Stephen Rothwell
  -1 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-14  4:50 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 2881 bytes --]

Hi Yinghai,

On Mon, 13 Sep 2010 01:24:20 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> On 09/12/2010 09:39 PM, Stephen Rothwell wrote:
> > 
> > Your patch fixes some of the warnings, but still leaves these for a
> > powerpc allnoconfig build:
> > 
> > WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
> > The function memblock_double_array() references
> > the function __init memblock_free().
> > This is often because memblock_double_array lacks a __init 
> > annotation or the annotation of memblock_free is wrong.
> > 
> > WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
> > The function memblock_reserve_reserved_regions() references
> > the function __init memblock_reserve().
> > This is often because memblock_reserve_reserved_regions lacks a __init 
> > annotation or the annotation of memblock_reserve is wrong.
> > 
> > WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
> > The function memblock_free_reserved_regions() references
> > the function __init memblock_free().
> > This is often because memblock_free_reserved_regions lacks a __init 
> > annotation or the annotation of memblock_free is wrong.
> 
> v1 already changed them all to __init_memblock, so we should not have those warnings.

They are still marked as __init in include/linux/memblock.h.  I don't
think that they need to be marked at all there.

> > And these for a i386 defconfig build:
> > 
> > WARNING: mm/built-in.o(.text+0x1e261): Section mismatch in reference from the function memblock_is_memory() to the variable .init.data:memblock
> > The function memblock_is_memory() references
> > the variable __initdata memblock.
> > This is often because memblock_is_memory lacks a __initdata 
> > annotation or the annotation of memblock is wrong.
> > 
> > WARNING: mm/built-in.o(.text+0x1e27f): Section mismatch in reference from the function memblock_is_region_memory() to the variable .init.data:memblock
> > The function memblock_is_region_memory() references
> > the variable __initdata memblock.
> > This is often because memblock_is_region_memory lacks a __initdata 
> > annotation or the annotation of memblock is wrong.
> 
> you must have old gcc, those functions are not used with i386.

I am not sure what the compiler version has to do with it, but I am using
gcc 4.4.4 which is fairly recent.  The X86 Kconfig selects HAVE_MEMBLOCK
unconditionally, so mm/memblock.c is built on i386.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-14  4:50         ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-14  4:50 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 2881 bytes --]

Hi Yinghai,

On Mon, 13 Sep 2010 01:24:20 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> On 09/12/2010 09:39 PM, Stephen Rothwell wrote:
> > 
> > Your patch fixes some of the warnings, but still leaves these for a
> > powerpc allnoconfig build:
> > 
> > WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
> > The function memblock_double_array() references
> > the function __init memblock_free().
> > This is often because memblock_double_array lacks a __init 
> > annotation or the annotation of memblock_free is wrong.
> > 
> > WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
> > The function memblock_reserve_reserved_regions() references
> > the function __init memblock_reserve().
> > This is often because memblock_reserve_reserved_regions lacks a __init 
> > annotation or the annotation of memblock_reserve is wrong.
> > 
> > WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
> > The function memblock_free_reserved_regions() references
> > the function __init memblock_free().
> > This is often because memblock_free_reserved_regions lacks a __init 
> > annotation or the annotation of memblock_free is wrong.
> 
> v1 already changed them all to __init_memblock, so we should not have those warnings.

They are still marked as __init in include/linux/memblock.h.  I don't
think that they need to be marked at all there.

> > And these for a i386 defconfig build:
> > 
> > WARNING: mm/built-in.o(.text+0x1e261): Section mismatch in reference from the function memblock_is_memory() to the variable .init.data:memblock
> > The function memblock_is_memory() references
> > the variable __initdata memblock.
> > This is often because memblock_is_memory lacks a __initdata 
> > annotation or the annotation of memblock is wrong.
> > 
> > WARNING: mm/built-in.o(.text+0x1e27f): Section mismatch in reference from the function memblock_is_region_memory() to the variable .init.data:memblock
> > The function memblock_is_region_memory() references
> > the variable __initdata memblock.
> > This is often because memblock_is_region_memory lacks a __initdata 
> > annotation or the annotation of memblock is wrong.
> 
> you must have old gcc, those functions are not used with i386.

I am not sure what the compiler version has to do with it, but I am using
gcc 4.4.4 which is fairly recent.  The X86 Kconfig selects HAVE_MEMBLOCK
unconditionally, so mm/memblock.c is built on i386.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-14  4:50         ` Stephen Rothwell
@ 2010-09-14 23:00           ` Yinghai Lu
  -1 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-14 23:00 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

On 09/13/2010 09:50 PM, Stephen Rothwell wrote:
> Hi Yinghai,
> 
> On Mon, 13 Sep 2010 01:24:20 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>>
>> On 09/12/2010 09:39 PM, Stephen Rothwell wrote:
>>>
>>> Your patch fixes some of the warnings, but still leaves these for a
>>> powerpc allnoconfig build:
>>>
>>> WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
>>> The function memblock_double_array() references
>>> the function __init memblock_free().
>>> This is often because memblock_double_array lacks a __init 
>>> annotation or the annotation of memblock_free is wrong.
>>>
>>> WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
>>> The function memblock_reserve_reserved_regions() references
>>> the function __init memblock_reserve().
>>> This is often because memblock_reserve_reserved_regions lacks a __init 
>>> annotation or the annotation of memblock_reserve is wrong.
>>>
>>> WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
>>> The function memblock_free_reserved_regions() references
>>> the function __init memblock_free().
>>> This is often because memblock_free_reserved_regions lacks a __init 
>>> annotation or the annotation of memblock_free is wrong.
>>
>> v1 already changed them all to __init_memblock, so we should not have those warnings.
> 
> They are still marked as __init in include/linux/memblock.h.  I don't
> think that they need to be marked at all there.

good,

Also, we may need to remove all extern and __init and __initdata etc in .h files.

please check

[PATCH -v3] memblock: Fix section mismatch warning

Use __init_memblock to replace __init, and remove __init in memblock.h

-v2: more with memblock_is_meory()
-v3: remove __init for function declaring in memblock.h. Pointed out by Stephen.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 include/linux/memblock.h |   44 ++++++++++++++++++++++----------------------
 mm/memblock.c            |   14 +++++++-------
 2 files changed, 29 insertions(+), 29 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_add
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }
Index: linux-2.6/include/linux/memblock.h
===================================================================
--- linux-2.6.orig/include/linux/memblock.h
+++ linux-2.6/include/linux/memblock.h
@@ -51,46 +51,46 @@ u64 memblock_find_in_range(u64 start, u6
 int memblock_free_reserved_regions(void);
 int memblock_reserve_reserved_regions(void);
 
-extern void __init memblock_init(void);
-extern void __init memblock_analyze(void);
-extern long memblock_add(phys_addr_t base, phys_addr_t size);
-extern long memblock_remove(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_free(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_reserve(phys_addr_t base, phys_addr_t size);
+void memblock_init(void);
+void memblock_analyze(void);
+long memblock_add(phys_addr_t base, phys_addr_t size);
+long memblock_remove(phys_addr_t base, phys_addr_t size);
+long memblock_free(phys_addr_t base, phys_addr_t size);
+long memblock_reserve(phys_addr_t base, phys_addr_t size);
 
 /* The numa aware allocator is only available if
  * CONFIG_ARCH_POPULATES_NODE_MAP is set
  */
-extern phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
+phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
 					int nid);
-extern phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
+phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
 					    int nid);
 
-extern phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align);
+phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
 
 /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
 #define MEMBLOCK_ALLOC_ANYWHERE	(~(phys_addr_t)0)
 #define MEMBLOCK_ALLOC_ACCESSIBLE	0
 
-extern phys_addr_t __init memblock_alloc_base(phys_addr_t size,
+phys_addr_t memblock_alloc_base(phys_addr_t size,
 					 phys_addr_t align,
 					 phys_addr_t max_addr);
-extern phys_addr_t __init __memblock_alloc_base(phys_addr_t size,
+phys_addr_t __memblock_alloc_base(phys_addr_t size,
 					   phys_addr_t align,
 					   phys_addr_t max_addr);
-extern phys_addr_t __init memblock_phys_mem_size(void);
-extern phys_addr_t memblock_end_of_DRAM(void);
-extern void __init memblock_enforce_memory_limit(phys_addr_t memory_limit);
-extern int memblock_is_memory(phys_addr_t addr);
-extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
-extern int __init memblock_is_reserved(phys_addr_t addr);
-extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
+phys_addr_t memblock_phys_mem_size(void);
+phys_addr_t memblock_end_of_DRAM(void);
+void memblock_enforce_memory_limit(phys_addr_t memory_limit);
+int memblock_is_memory(phys_addr_t addr);
+int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
+int memblock_is_reserved(phys_addr_t addr);
+int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
 
-extern void memblock_dump_all(void);
+void memblock_dump_all(void);
 
 /* Provided by the architecture */
-extern phys_addr_t memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid);
-extern int memblock_memory_can_coalesce(phys_addr_t addr1, phys_addr_t size1,
+phys_addr_t memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid);
+int memblock_memory_can_coalesce(phys_addr_t addr1, phys_addr_t size1,
 				   phys_addr_t addr2, phys_addr_t size2);
 
 /**
@@ -99,7 +99,7 @@ extern int memblock_memory_can_coalesce(
  *                         accessible during boot
  * @limit: New limit value (physical address)
  */
-extern void memblock_set_current_limit(phys_addr_t limit);
+void memblock_set_current_limit(phys_addr_t limit);
 
 
 /*

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-14 23:00           ` Yinghai Lu
  0 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-14 23:00 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

On 09/13/2010 09:50 PM, Stephen Rothwell wrote:
> Hi Yinghai,
> 
> On Mon, 13 Sep 2010 01:24:20 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>>
>> On 09/12/2010 09:39 PM, Stephen Rothwell wrote:
>>>
>>> Your patch fixes some of the warnings, but still leaves these for a
>>> powerpc allnoconfig build:
>>>
>>> WARNING: mm/built-in.o(.text+0x25d80): Section mismatch in reference from the function memblock_double_array() to the function .init.text:memblock_free()
>>> The function memblock_double_array() references
>>> the function __init memblock_free().
>>> This is often because memblock_double_array lacks a __init 
>>> annotation or the annotation of memblock_free is wrong.
>>>
>>> WARNING: mm/built-in.o(.text+0x26318): Section mismatch in reference from the function memblock_reserve_reserved_regions() to the function .init.text:memblock_reserve()
>>> The function memblock_reserve_reserved_regions() references
>>> the function __init memblock_reserve().
>>> This is often because memblock_reserve_reserved_regions lacks a __init 
>>> annotation or the annotation of memblock_reserve is wrong.
>>>
>>> WARNING: mm/built-in.o(.text+0x26490): Section mismatch in reference from the function memblock_free_reserved_regions() to the function .init.text:memblock_free()
>>> The function memblock_free_reserved_regions() references
>>> the function __init memblock_free().
>>> This is often because memblock_free_reserved_regions lacks a __init 
>>> annotation or the annotation of memblock_free is wrong.
>>
>> v1 already changed them all to __init_memblock, so we should not have those warnings.
> 
> They are still marked as __init in include/linux/memblock.h.  I don't
> think that they need to be marked at all there.

good,

Also, we may need to remove all extern and __init and __initdata etc in .h files.

please check

[PATCH -v3] memblock: Fix section mismatch warning

Use __init_memblock to replace __init, and remove __init in memblock.h

-v2: more with memblock_is_meory()
-v3: remove __init for function declaring in memblock.h. Pointed out by Stephen.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 include/linux/memblock.h |   44 ++++++++++++++++++++++----------------------
 mm/memblock.c            |   14 +++++++-------
 2 files changed, 29 insertions(+), 29 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_add
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }
Index: linux-2.6/include/linux/memblock.h
===================================================================
--- linux-2.6.orig/include/linux/memblock.h
+++ linux-2.6/include/linux/memblock.h
@@ -51,46 +51,46 @@ u64 memblock_find_in_range(u64 start, u6
 int memblock_free_reserved_regions(void);
 int memblock_reserve_reserved_regions(void);
 
-extern void __init memblock_init(void);
-extern void __init memblock_analyze(void);
-extern long memblock_add(phys_addr_t base, phys_addr_t size);
-extern long memblock_remove(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_free(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_reserve(phys_addr_t base, phys_addr_t size);
+void memblock_init(void);
+void memblock_analyze(void);
+long memblock_add(phys_addr_t base, phys_addr_t size);
+long memblock_remove(phys_addr_t base, phys_addr_t size);
+long memblock_free(phys_addr_t base, phys_addr_t size);
+long memblock_reserve(phys_addr_t base, phys_addr_t size);
 
 /* The numa aware allocator is only available if
  * CONFIG_ARCH_POPULATES_NODE_MAP is set
  */
-extern phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
+phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
 					int nid);
-extern phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
+phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
 					    int nid);
 
-extern phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align);
+phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
 
 /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
 #define MEMBLOCK_ALLOC_ANYWHERE	(~(phys_addr_t)0)
 #define MEMBLOCK_ALLOC_ACCESSIBLE	0
 
-extern phys_addr_t __init memblock_alloc_base(phys_addr_t size,
+phys_addr_t memblock_alloc_base(phys_addr_t size,
 					 phys_addr_t align,
 					 phys_addr_t max_addr);
-extern phys_addr_t __init __memblock_alloc_base(phys_addr_t size,
+phys_addr_t __memblock_alloc_base(phys_addr_t size,
 					   phys_addr_t align,
 					   phys_addr_t max_addr);
-extern phys_addr_t __init memblock_phys_mem_size(void);
-extern phys_addr_t memblock_end_of_DRAM(void);
-extern void __init memblock_enforce_memory_limit(phys_addr_t memory_limit);
-extern int memblock_is_memory(phys_addr_t addr);
-extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
-extern int __init memblock_is_reserved(phys_addr_t addr);
-extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
+phys_addr_t memblock_phys_mem_size(void);
+phys_addr_t memblock_end_of_DRAM(void);
+void memblock_enforce_memory_limit(phys_addr_t memory_limit);
+int memblock_is_memory(phys_addr_t addr);
+int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
+int memblock_is_reserved(phys_addr_t addr);
+int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
 
-extern void memblock_dump_all(void);
+void memblock_dump_all(void);
 
 /* Provided by the architecture */
-extern phys_addr_t memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid);
-extern int memblock_memory_can_coalesce(phys_addr_t addr1, phys_addr_t size1,
+phys_addr_t memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid);
+int memblock_memory_can_coalesce(phys_addr_t addr1, phys_addr_t size1,
 				   phys_addr_t addr2, phys_addr_t size2);
 
 /**
@@ -99,7 +99,7 @@ extern int memblock_memory_can_coalesce(
  *                         accessible during boot
  * @limit: New limit value (physical address)
  */
-extern void memblock_set_current_limit(phys_addr_t limit);
+void memblock_set_current_limit(phys_addr_t limit);
 
 
 /*

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-14 23:00           ` Yinghai Lu
@ 2010-09-15  0:29             ` Stephen Rothwell
  -1 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-15  0:29 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Hi Yinghai,

On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> Also, we may need to remove all extern and __init and __initdata etc in .h files.

Do not remove the "extern" key word.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-15  0:29             ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-15  0:29 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Hi Yinghai,

On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> Also, we may need to remove all extern and __init and __initdata etc in .h files.

Do not remove the "extern" key word.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-15  0:29             ` Stephen Rothwell
@ 2010-09-15  1:33               ` Yinghai Lu
  -1 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-15  1:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

On 09/14/2010 05:29 PM, Stephen Rothwell wrote:
> Hi Yinghai,
> 
> On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>>
>> Also, we may need to remove all extern and __init and __initdata etc in .h files.
> 
> Do not remove the "extern" key word.
> 

why? you got another warning?

Yinghai

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-15  1:33               ` Yinghai Lu
  0 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-15  1:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

On 09/14/2010 05:29 PM, Stephen Rothwell wrote:
> Hi Yinghai,
> 
> On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>>
>> Also, we may need to remove all extern and __init and __initdata etc in .h files.
> 
> Do not remove the "extern" key word.
> 

why? you got another warning?

Yinghai

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-15  1:33               ` Yinghai Lu
@ 2010-09-15  4:39                 ` Stephen Rothwell
  -1 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-15  4:39 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

Hi Yinghai,

On Tue, 14 Sep 2010 18:33:34 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> On 09/14/2010 05:29 PM, Stephen Rothwell wrote:
> > 
> > Do not remove the "extern" key word.
> 
> why? you got another warning?

It is normal C coding practice to mark declarations in header files with
extern.  It probably doesn't strictly matter for functions, but I have
seen a case where not doing so to a variable lead to multiple definitions
of the variable.  Consistency is also good.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-15  4:39                 ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-15  4:39 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

Hi Yinghai,

On Tue, 14 Sep 2010 18:33:34 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> On 09/14/2010 05:29 PM, Stephen Rothwell wrote:
> > 
> > Do not remove the "extern" key word.
> 
> why? you got another warning?

It is normal C coding practice to mark declarations in header files with
extern.  It probably doesn't strictly matter for functions, but I have
seen a case where not doing so to a variable lead to multiple definitions
of the variable.  Consistency is also good.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-14 23:00           ` Yinghai Lu
@ 2010-09-15  5:00             ` Stephen Rothwell
  -1 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-15  5:00 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

Hi Yinghai,

On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> Also, we may need to remove all extern and __init and __initdata etc in .h files.
> 
> please check
> 
> [PATCH -v3] memblock: Fix section mismatch warning
> 
> Use __init_memblock to replace __init, and remove __init in memblock.h
> 
> -v2: more with memblock_is_meory()
> -v3: remove __init for function declaring in memblock.h. Pointed out by Stephen.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

This version fixes all the warnings for me.  So if you put the "extern"s
back, you can add:

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-15  5:00             ` Stephen Rothwell
  0 siblings, 0 replies; 25+ messages in thread
From: Stephen Rothwell @ 2010-09-15  5:00 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Ingo Molnar, ppc-dev, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

Hi Yinghai,

On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
>
> Also, we may need to remove all extern and __init and __initdata etc in .h files.
> 
> please check
> 
> [PATCH -v3] memblock: Fix section mismatch warning
> 
> Use __init_memblock to replace __init, and remove __init in memblock.h
> 
> -v2: more with memblock_is_meory()
> -v3: remove __init for function declaring in memblock.h. Pointed out by Stephen.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

This version fixes all the warnings for me.  So if you put the "extern"s
back, you can add:

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
  2010-09-15  5:00             ` Stephen Rothwell
@ 2010-09-15  9:25               ` Ingo Molnar
  -1 siblings, 0 replies; 25+ messages in thread
From: Ingo Molnar @ 2010-09-15  9:25 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Yinghai Lu, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	linux-next, linux-kernel, Benjamin Herrenschmidt, ppc-dev


* Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Yinghai,
> 
> On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
> >
> > Also, we may need to remove all extern and __init and __initdata etc in .h files.
> > 
> > please check
> > 
> > [PATCH -v3] memblock: Fix section mismatch warning
> > 
> > Use __init_memblock to replace __init, and remove __init in memblock.h
> > 
> > -v2: more with memblock_is_meory()
> > -v3: remove __init for function declaring in memblock.h. Pointed out by Stephen.
> > 
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Yinghai Lu <Yinghai@kernel.org>
> 
> This version fixes all the warnings for me.  So if you put the "extern"s
> back, you can add:
> 
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

Yinghai, mind posting the final version of the patch as a standalone 
posting, with a proper changelog, and with the extern issue fixed as 
well, plus all Reported-by and Tested-by tags added?

Thanks,

	Ingo

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

* Re: linux-next: build warnings after merge of the final tree (tip treee related)
@ 2010-09-15  9:25               ` Ingo Molnar
  0 siblings, 0 replies; 25+ messages in thread
From: Ingo Molnar @ 2010-09-15  9:25 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Peter Zijlstra, ppc-dev, linux-kernel, linux-next,
	H. Peter Anvin, Thomas Gleixner, Yinghai Lu


* Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Yinghai,
> 
> On Tue, 14 Sep 2010 16:00:06 -0700 Yinghai Lu <yinghai@kernel.org> wrote:
> >
> > Also, we may need to remove all extern and __init and __initdata etc in .h files.
> > 
> > please check
> > 
> > [PATCH -v3] memblock: Fix section mismatch warning
> > 
> > Use __init_memblock to replace __init, and remove __init in memblock.h
> > 
> > -v2: more with memblock_is_meory()
> > -v3: remove __init for function declaring in memblock.h. Pointed out by Stephen.
> > 
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Yinghai Lu <Yinghai@kernel.org>
> 
> This version fixes all the warnings for me.  So if you put the "extern"s
> back, you can add:
> 
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

Yinghai, mind posting the final version of the patch as a standalone 
posting, with a proper changelog, and with the extern issue fixed as 
well, plus all Reported-by and Tested-by tags added?

Thanks,

	Ingo

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

* [PATCH -v4] memblock: Fix section mismatch warnings
  2010-09-15  9:25               ` Ingo Molnar
@ 2010-09-15 20:05                 ` Yinghai Lu
  -1 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-15 20:05 UTC (permalink / raw)
  To: Ingo Molnar, Stephen Rothwell
  Cc: Thomas Gleixner, H. Peter Anvin, Peter Zijlstra, linux-next,
	linux-kernel, Benjamin Herrenschmidt, ppc-dev



Stephen found bunch of section mismatch warnings with memblock new changes.

Use __init_memblock to replace __init in memblock.c and remove __init in memblock.h.
We should not use __init in header files.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 include/linux/memblock.h |   24 ++++++++++++------------
 mm/memblock.c            |   14 +++++++-------
 2 files changed, 19 insertions(+), 19 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_add
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }
Index: linux-2.6/include/linux/memblock.h
===================================================================
--- linux-2.6.orig/include/linux/memblock.h
+++ linux-2.6/include/linux/memblock.h
@@ -51,39 +51,39 @@ u64 memblock_find_in_range(u64 start, u6
 int memblock_free_reserved_regions(void);
 int memblock_reserve_reserved_regions(void);
 
-extern void __init memblock_init(void);
-extern void __init memblock_analyze(void);
+extern void memblock_init(void);
+extern void memblock_analyze(void);
 extern long memblock_add(phys_addr_t base, phys_addr_t size);
 extern long memblock_remove(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_free(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_reserve(phys_addr_t base, phys_addr_t size);
+extern long memblock_free(phys_addr_t base, phys_addr_t size);
+extern long memblock_reserve(phys_addr_t base, phys_addr_t size);
 
 /* The numa aware allocator is only available if
  * CONFIG_ARCH_POPULATES_NODE_MAP is set
  */
-extern phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
+extern phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
 					int nid);
-extern phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
+extern phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
 					    int nid);
 
-extern phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align);
+extern phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
 
 /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
 #define MEMBLOCK_ALLOC_ANYWHERE	(~(phys_addr_t)0)
 #define MEMBLOCK_ALLOC_ACCESSIBLE	0
 
-extern phys_addr_t __init memblock_alloc_base(phys_addr_t size,
+extern phys_addr_t memblock_alloc_base(phys_addr_t size,
 					 phys_addr_t align,
 					 phys_addr_t max_addr);
-extern phys_addr_t __init __memblock_alloc_base(phys_addr_t size,
+extern phys_addr_t __memblock_alloc_base(phys_addr_t size,
 					   phys_addr_t align,
 					   phys_addr_t max_addr);
-extern phys_addr_t __init memblock_phys_mem_size(void);
+extern phys_addr_t memblock_phys_mem_size(void);
 extern phys_addr_t memblock_end_of_DRAM(void);
-extern void __init memblock_enforce_memory_limit(phys_addr_t memory_limit);
+extern void memblock_enforce_memory_limit(phys_addr_t memory_limit);
 extern int memblock_is_memory(phys_addr_t addr);
 extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
-extern int __init memblock_is_reserved(phys_addr_t addr);
+extern int memblock_is_reserved(phys_addr_t addr);
 extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
 
 extern void memblock_dump_all(void);

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

* [PATCH -v4] memblock: Fix section mismatch warnings
@ 2010-09-15 20:05                 ` Yinghai Lu
  0 siblings, 0 replies; 25+ messages in thread
From: Yinghai Lu @ 2010-09-15 20:05 UTC (permalink / raw)
  To: Ingo Molnar, Stephen Rothwell
  Cc: Peter Zijlstra, linux-kernel, linux-next, H. Peter Anvin,
	Thomas Gleixner, ppc-dev



Stephen found bunch of section mismatch warnings with memblock new changes.

Use __init_memblock to replace __init in memblock.c and remove __init in memblock.h.
We should not use __init in header files.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>

---
 include/linux/memblock.h |   24 ++++++++++++------------
 mm/memblock.c            |   14 +++++++-------
 2 files changed, 19 insertions(+), 19 deletions(-)

Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phy
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_add
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_r
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }
Index: linux-2.6/include/linux/memblock.h
===================================================================
--- linux-2.6.orig/include/linux/memblock.h
+++ linux-2.6/include/linux/memblock.h
@@ -51,39 +51,39 @@ u64 memblock_find_in_range(u64 start, u6
 int memblock_free_reserved_regions(void);
 int memblock_reserve_reserved_regions(void);
 
-extern void __init memblock_init(void);
-extern void __init memblock_analyze(void);
+extern void memblock_init(void);
+extern void memblock_analyze(void);
 extern long memblock_add(phys_addr_t base, phys_addr_t size);
 extern long memblock_remove(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_free(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_reserve(phys_addr_t base, phys_addr_t size);
+extern long memblock_free(phys_addr_t base, phys_addr_t size);
+extern long memblock_reserve(phys_addr_t base, phys_addr_t size);
 
 /* The numa aware allocator is only available if
  * CONFIG_ARCH_POPULATES_NODE_MAP is set
  */
-extern phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
+extern phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
 					int nid);
-extern phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
+extern phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
 					    int nid);
 
-extern phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align);
+extern phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
 
 /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
 #define MEMBLOCK_ALLOC_ANYWHERE	(~(phys_addr_t)0)
 #define MEMBLOCK_ALLOC_ACCESSIBLE	0
 
-extern phys_addr_t __init memblock_alloc_base(phys_addr_t size,
+extern phys_addr_t memblock_alloc_base(phys_addr_t size,
 					 phys_addr_t align,
 					 phys_addr_t max_addr);
-extern phys_addr_t __init __memblock_alloc_base(phys_addr_t size,
+extern phys_addr_t __memblock_alloc_base(phys_addr_t size,
 					   phys_addr_t align,
 					   phys_addr_t max_addr);
-extern phys_addr_t __init memblock_phys_mem_size(void);
+extern phys_addr_t memblock_phys_mem_size(void);
 extern phys_addr_t memblock_end_of_DRAM(void);
-extern void __init memblock_enforce_memory_limit(phys_addr_t memory_limit);
+extern void memblock_enforce_memory_limit(phys_addr_t memory_limit);
 extern int memblock_is_memory(phys_addr_t addr);
 extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
-extern int __init memblock_is_reserved(phys_addr_t addr);
+extern int memblock_is_reserved(phys_addr_t addr);
 extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
 
 extern void memblock_dump_all(void);

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

* [tip:core/memblock] memblock: Fix section mismatch warnings
  2010-09-15 20:05                 ` Yinghai Lu
  (?)
@ 2010-09-16 14:43                 ` tip-bot for Yinghai Lu
  -1 siblings, 0 replies; 25+ messages in thread
From: tip-bot for Yinghai Lu @ 2010-09-16 14:43 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, peterz, Yinghai, benh, tglx,
	sfr, mingo

Commit-ID:  3661ca66a42e306aaf53246fb75aec1ea01be0f0
Gitweb:     http://git.kernel.org/tip/3661ca66a42e306aaf53246fb75aec1ea01be0f0
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Wed, 15 Sep 2010 13:05:29 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 15 Sep 2010 22:17:13 +0200

memblock: Fix section mismatch warnings

Stephen found a bunch of section mismatch warnings with the
new memblock changes.

Use __init_memblock to replace __init in memblock.c and remove
__init in memblock.h. We should not use __init in header files.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
LKML-Reference: <4C912709.2090201@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/memblock.h |   24 ++++++++++++------------
 mm/memblock.c            |   14 +++++++-------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 7d28527..5096458 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -51,39 +51,39 @@ u64 memblock_find_in_range(u64 start, u64 end, u64 size, u64 align);
 int memblock_free_reserved_regions(void);
 int memblock_reserve_reserved_regions(void);
 
-extern void __init memblock_init(void);
-extern void __init memblock_analyze(void);
+extern void memblock_init(void);
+extern void memblock_analyze(void);
 extern long memblock_add(phys_addr_t base, phys_addr_t size);
 extern long memblock_remove(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_free(phys_addr_t base, phys_addr_t size);
-extern long __init memblock_reserve(phys_addr_t base, phys_addr_t size);
+extern long memblock_free(phys_addr_t base, phys_addr_t size);
+extern long memblock_reserve(phys_addr_t base, phys_addr_t size);
 
 /* The numa aware allocator is only available if
  * CONFIG_ARCH_POPULATES_NODE_MAP is set
  */
-extern phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
+extern phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
 					int nid);
-extern phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
+extern phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
 					    int nid);
 
-extern phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align);
+extern phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
 
 /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
 #define MEMBLOCK_ALLOC_ANYWHERE	(~(phys_addr_t)0)
 #define MEMBLOCK_ALLOC_ACCESSIBLE	0
 
-extern phys_addr_t __init memblock_alloc_base(phys_addr_t size,
+extern phys_addr_t memblock_alloc_base(phys_addr_t size,
 					 phys_addr_t align,
 					 phys_addr_t max_addr);
-extern phys_addr_t __init __memblock_alloc_base(phys_addr_t size,
+extern phys_addr_t __memblock_alloc_base(phys_addr_t size,
 					   phys_addr_t align,
 					   phys_addr_t max_addr);
-extern phys_addr_t __init memblock_phys_mem_size(void);
+extern phys_addr_t memblock_phys_mem_size(void);
 extern phys_addr_t memblock_end_of_DRAM(void);
-extern void __init memblock_enforce_memory_limit(phys_addr_t memory_limit);
+extern void memblock_enforce_memory_limit(phys_addr_t memory_limit);
 extern int memblock_is_memory(phys_addr_t addr);
 extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
-extern int __init memblock_is_reserved(phys_addr_t addr);
+extern int memblock_is_reserved(phys_addr_t addr);
 extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
 
 extern void memblock_dump_all(void);
diff --git a/mm/memblock.c b/mm/memblock.c
index 65e3ba8d..d5d63ac 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -125,8 +125,8 @@ static phys_addr_t __init memblock_find_region(phys_addr_t start, phys_addr_t en
 	return MEMBLOCK_ERROR;
 }
 
-static phys_addr_t __init memblock_find_base(phys_addr_t size, phys_addr_t align,
-					phys_addr_t start, phys_addr_t end)
+static phys_addr_t __init_memblock memblock_find_base(phys_addr_t size,
+			phys_addr_t align, phys_addr_t start, phys_addr_t end)
 {
 	long i;
 
@@ -439,12 +439,12 @@ long __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
 	return __memblock_remove(&memblock.memory, base, size);
 }
 
-long __init memblock_free(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
 {
 	return __memblock_remove(&memblock.reserved, base, size);
 }
 
-long __init memblock_reserve(phys_addr_t base, phys_addr_t size)
+long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
 {
 	struct memblock_type *_rgn = &memblock.reserved;
 
@@ -671,12 +671,12 @@ int __init memblock_is_reserved(phys_addr_t addr)
 	return memblock_search(&memblock.reserved, addr) != -1;
 }
 
-int memblock_is_memory(phys_addr_t addr)
+int __init_memblock memblock_is_memory(phys_addr_t addr)
 {
 	return memblock_search(&memblock.memory, addr) != -1;
 }
 
-int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
+int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
 	int idx = memblock_search(&memblock.reserved, base);
 
@@ -693,7 +693,7 @@ int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t si
 }
 
 
-void __init memblock_set_current_limit(phys_addr_t limit)
+void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {
 	memblock.current_limit = limit;
 }

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

end of thread, other threads:[~2010-09-16 14:43 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-13  3:27 linux-next: build warnings after merge of the final tree (tip treee related) Stephen Rothwell
2010-09-13  3:27 ` Stephen Rothwell
2010-09-13  4:14 ` Yinghai Lu
2010-09-13  4:14   ` Yinghai Lu
2010-09-13  4:39   ` Stephen Rothwell
2010-09-13  4:39     ` Stephen Rothwell
2010-09-13  8:24     ` Yinghai Lu
2010-09-13  8:24       ` Yinghai Lu
2010-09-14  4:50       ` Stephen Rothwell
2010-09-14  4:50         ` Stephen Rothwell
2010-09-14 23:00         ` Yinghai Lu
2010-09-14 23:00           ` Yinghai Lu
2010-09-15  0:29           ` Stephen Rothwell
2010-09-15  0:29             ` Stephen Rothwell
2010-09-15  1:33             ` Yinghai Lu
2010-09-15  1:33               ` Yinghai Lu
2010-09-15  4:39               ` Stephen Rothwell
2010-09-15  4:39                 ` Stephen Rothwell
2010-09-15  5:00           ` Stephen Rothwell
2010-09-15  5:00             ` Stephen Rothwell
2010-09-15  9:25             ` Ingo Molnar
2010-09-15  9:25               ` Ingo Molnar
2010-09-15 20:05               ` [PATCH -v4] memblock: Fix section mismatch warnings Yinghai Lu
2010-09-15 20:05                 ` Yinghai Lu
2010-09-16 14:43                 ` [tip:core/memblock] " tip-bot for Yinghai Lu

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.