mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: chengang@emindsoft.com.cn
Cc: will.deacon@arm.com, tangchen@cn.fujitsu.com,
	kuleshovmail@gmail.com, tony.luck@intel.com,
	vladimir.murzin@arm.com, baiyaowei@cmss.chinamobile.com,
	holt@sgi.com, ard.biesheuvel@linaro.org,
	linux-kernel@vger.kernel.org,
	Chen Gang <gang.chen.5i5j@gmail.com>
Subject: Re: [PATCH] include/linux/memblock.h: Use __init_memblock for movable_node_is_enabled
Date: Tue, 5 Jan 2016 14:35:46 -0800	[thread overview]
Message-ID: <20160105143546.7b3aa50adbac72daf8c09540@linux-foundation.org> (raw)
In-Reply-To: <1452032756-10196-1-git-send-email-chengang@emindsoft.com.cn>

On Wed,  6 Jan 2016 06:25:56 +0800 chengang@emindsoft.com.cn wrote:

> The related warning:
> 
>     LD      mm/built-in.o
>   WARNING: mm/built-in.o(.text.unlikely+0x155d): Section mismatch in reference from the function movable_node_is_enabled() to the variable .meminit.data:movable_node_enabled
>   The function movable_node_is_enabled() references
>   the variable __meminitdata movable_node_enabled.
>   This is often because movable_node_is_enabled lacks a __meminitdata
>   annotation or the annotation of movable_node_enabled is wrong.

Thanks.  Kirill just sent (almost) the same patch:



From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: memblock: fix section mismatch

allmodconfig produces following warning for me:

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

Let's mark the function with __meminit. It fixes the warning.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/memblock.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff -puN include/linux/memblock.h~memblock-fix-section-mismatch include/linux/memblock.h
--- a/include/linux/memblock.h~memblock-fix-section-mismatch
+++ a/include/linux/memblock.h
@@ -60,6 +60,14 @@ extern int memblock_debug;
 extern bool movable_node_enabled;
 #endif /* CONFIG_MOVABLE_NODE */
 
+#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
+#define __init_memblock __meminit
+#define __initdata_memblock __meminitdata
+#else
+#define __init_memblock
+#define __initdata_memblock
+#endif
+
 #define memblock_dbg(fmt, ...) \
 	if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
@@ -164,7 +172,7 @@ static inline bool memblock_is_hotplugga
 	return m->flags & MEMBLOCK_HOTPLUG;
 }
 
-static inline bool movable_node_is_enabled(void)
+static inline bool __init_memblock movable_node_is_enabled(void)
 {
 	return movable_node_enabled;
 }
@@ -397,14 +405,6 @@ static inline unsigned long memblock_reg
 	for (idx = 0; idx < memblock_type->cnt;				\
 	     idx++,rgn = &memblock_type->regions[idx])
 
-#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
-#define __init_memblock __meminit
-#define __initdata_memblock __meminitdata
-#else
-#define __init_memblock
-#define __initdata_memblock
-#endif
-
 #ifdef CONFIG_MEMTEST
 extern void early_memtest(phys_addr_t start, phys_addr_t end);
 #else
_


  reply	other threads:[~2016-01-05 22:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 22:25 chengang
2016-01-05 22:35 ` Andrew Morton [this message]
2016-01-06  0:57   ` Chen Gang

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=20160105143546.7b3aa50adbac72daf8c09540@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=baiyaowei@cmss.chinamobile.com \
    --cc=chengang@emindsoft.com.cn \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=holt@sgi.com \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=tony.luck@intel.com \
    --cc=vladimir.murzin@arm.com \
    --cc=will.deacon@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®