diff mbox

of: Fix the section mismatch warnings.

Message ID 1396936087-23043-1-git-send-email-Li.Xiubo@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xiubo Li April 8, 2014, 5:48 a.m. UTC
In tag next-20140407, building with CONFIG_DEBUG_SECTION_MISMATCH
enabled, the following WARNING is occured:

WARNING: drivers/built-in.o(.text.unlikely+0x2220): Section mismatch
in reference from the function __reserved_mem_check_root() to the
function .init.text:of_get_flat_dt_prop()
The function __reserved_mem_check_root() references
the function __init of_get_flat_dt_prop().
This is often because __reserved_mem_check_root lacks a __init
annotation or the annotation of of_get_flat_dt_prop is wrong.

WARNING: vmlinux.o(.text.unlikely+0xb9d0): Section mismatch in reference
from the function __reserved_mem_check_root() to the (unknown reference)
.init.data:(unknown)
The function __reserved_mem_check_root() references
the (unknown reference) __initdata (unknown).
This is often because __reserved_mem_check_root lacks a __initdata
annotation or the annotation of (unknown) is wrong.

This is cause by :
'drivers: of: add initialization code for dynamic reserved memory'.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring April 8, 2014, 12:55 p.m. UTC | #1
On Tue, Apr 8, 2014 at 12:48 AM, Xiubo Li <Li.Xiubo@freescale.com> wrote:
> In tag next-20140407, building with CONFIG_DEBUG_SECTION_MISMATCH
> enabled, the following WARNING is occured:
>
> WARNING: drivers/built-in.o(.text.unlikely+0x2220): Section mismatch
> in reference from the function __reserved_mem_check_root() to the
> function .init.text:of_get_flat_dt_prop()
> The function __reserved_mem_check_root() references
> the function __init of_get_flat_dt_prop().
> This is often because __reserved_mem_check_root lacks a __init
> annotation or the annotation of of_get_flat_dt_prop is wrong.
>
> WARNING: vmlinux.o(.text.unlikely+0xb9d0): Section mismatch in reference
> from the function __reserved_mem_check_root() to the (unknown reference)
> .init.data:(unknown)
> The function __reserved_mem_check_root() references
> the (unknown reference) __initdata (unknown).
> This is often because __reserved_mem_check_root lacks a __initdata
> annotation or the annotation of (unknown) is wrong.
>
> This is cause by :
> 'drivers: of: add initialization code for dynamic reserved memory'.
>
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>

Applied.

Rob
diff mbox

Patch

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index fa16a91..7a2ef7b 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -491,7 +491,7 @@  static int __init __reserved_mem_reserve_reg(unsigned long node,
  * in /reserved-memory matches the values supported by the current implementation,
  * also check if ranges property has been provided
  */
-static int __reserved_mem_check_root(unsigned long node)
+static int __init __reserved_mem_check_root(unsigned long node)
 {
 	__be32 *prop;