linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Avoid section mismatch warning for memblock_type_name.
@ 2012-09-28 11:16 raghu.prabhu13
  2012-10-01 20:08 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: raghu.prabhu13 @ 2012-09-28 11:16 UTC (permalink / raw)
  To: linux-mm; +Cc: tj, benh, akpm, Raghavendra D Prabhu

From: Raghavendra D Prabhu <rprabhu@wnohang.net>

Following section mismatch warning is thrown during build;

    WARNING: vmlinux.o(.text+0x32408f): Section mismatch in reference from the function memblock_type_name() to the variable .meminit.data:memblock
    The function memblock_type_name() references
    the variable __meminitdata memblock.
    This is often because memblock_type_name lacks a __meminitdata
    annotation or the annotation of memblock is wrong.

This is because memblock_type_name makes reference to memblock variable with
attribute __meminitdata. Hence, the warning (even if the function is inline).

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
---
 mm/memblock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 82aa349..8e7fb1f 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -41,7 +41,8 @@ static int memblock_memory_in_slab __initdata_memblock = 0;
 static int memblock_reserved_in_slab __initdata_memblock = 0;
 
 /* inline so we don't get a warning when pr_debug is compiled out */
-static inline const char *memblock_type_name(struct memblock_type *type)
+static inline __init_memblock
+		const char *memblock_type_name(struct memblock_type *type)
 {
 	if (type == &memblock.memory)
 		return "memory";
-- 
1.7.12.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-10-01 20:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 11:16 [PATCH] mm: Avoid section mismatch warning for memblock_type_name raghu.prabhu13
2012-10-01 20:08 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).