From: Yinghai Lu <yinghai@kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
ppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: linux-next: build warnings after merge of the final tree (tip treee related)
Date: Tue, 14 Sep 2010 16:00:06 -0700 [thread overview]
Message-ID: <4C8FFE76.8070801@kernel.org> (raw)
In-Reply-To: <20100914145025.977ec2a6.sfr@canb.auug.org.au>
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);
/*
WARNING: multiple messages have this Message-ID (diff)
From: Yinghai Lu <yinghai@kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
ppc-dev <linuxppc-dev@lists.ozlabs.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: linux-next: build warnings after merge of the final tree (tip treee related)
Date: Tue, 14 Sep 2010 16:00:06 -0700 [thread overview]
Message-ID: <4C8FFE76.8070801@kernel.org> (raw)
In-Reply-To: <20100914145025.977ec2a6.sfr@canb.auug.org.au>
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);
/*
next prev parent reply other threads:[~2010-09-14 23:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C8FFE76.8070801@kernel.org \
--to=yinghai@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.