Skip to contentSkip to conversation

linux-next: build warning after merge of the ftrace tree

PATCH New Stephen Rothwell 2 participants 3 messages Oct 25, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the ftrace tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

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

Introduced by commit

4ee1b4cac236 ("bootconfig: Cleanup dummy headers in tools/bootconfig")

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#1 lore raw
Quoted 11 lines · On Mon, 25 Oct 2021 15:39:42 +1100 Stephen Rothwell <[email protected]>…

Hi all,

After merging the ftrace tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

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

Quoted 3 lines

Introduced by commit

4ee1b4cac236 ("bootconfig: Cleanup dummy headers in tools/bootconfig")

Thanks for reporting!
Let me fix that.

Quoted 4 lines
Signature · 3 lines
-- 
Cheers,
Stephen Rothwell
Signature · 1 line
Masami Hiramatsu <[email protected]>
maintainer
#2 lore raw

PATCH 1/1 lib/bootconfig: Make xbc_alloc_mem() and xbc_free_mem() as __init function

Since the xbc_alloc_mem() and xbc_free_mem() are used from the __init functions and memblock_alloc() is __init function, make them __init functions too.

Fixes 4ee1b4cac236 ("bootconfig: Cleanup dummy headers in tools/bootconfig")
---
 lib/bootconfig.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bootconfig.c +2 -2
index a056ae137750..3276675b25e1 100644
@@ -43,12 +43,12 @@ static int open_brace[XBC_DEPTH_MAX] __initdata;
 static int brace_index __initdata;
 
 #ifdef __KERNEL__
-static inline void *xbc_alloc_mem(size_t size)
+static inline void * __init xbc_alloc_mem(size_t size)
 {
 	return memblock_alloc(size, SMP_CACHE_BYTES);
 }
 
-static inline void xbc_free_mem(void *addr, size_t size)
+static inline void __init xbc_free_mem(void *addr, size_t size)
 {
 	memblock_free_ptr(addr, size);
 }