linux-next: build warning after merge of the ftrace tree
Subsystems (3)
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
Masami Hiramatsu
maintainerQuoted 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_64allmodconfig) produced this warning:WARNING: modpost:
vmlinux.o(.text.unlikely+0x90082): Section mismatch in reference from the functionxbc_alloc_mem()to the function .init.text:memblock_alloc_try_nid() The functionxbc_alloc_mem()references
the function__initmemblock_alloc_try_nid().
This is often becausexbc_alloc_memlacks a__init
annotation or the annotation ofmemblock_alloc_try_nidis wrong.
Quoted 3 lines
Introduced by commit
4ee1b4cac236("bootconfig: Cleanup dummy headers intools/bootconfig")
Thanks for reporting!
Let me fix that.
Quoted 4 lines
Signature · 3 lines
-- Cheers, Stephen Rothwell
Signature · 1 line
Masami Hiramatsu <[email protected]>
Masami Hiramatsu
maintainerPATCH 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.
--- lib/bootconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bootconfig.c +2 -2
@@ -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); }