Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/cpu_entry_area: Annotate percpu_setup_exception_stacks() as __init

After a recent LLVM change that deduces __cold on functions that only call
cold code (such as __init functions), there is a section mismatch warning
from percpu_setup_exception_stacks(), which got moved to .text.unlikely. as
a result of that optimization:

WARNING: modpost: vmlinux: section mismatch in reference:
percpu_setup_exception_stacks+0x3a (section: .text.unlikely.) ->
cea_map_percpu_pages (section: .init.text)

Drop the inline keyword, which does not guarantee inlining, and replace it
with __init, as percpu_setup_exception_stacks() is only called from __init
code, which clears up the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240822-x86-percpu_setup_exception_stacks-init-v1-1-57c5921b8209@kernel.org

authored by

Nathan Chancellor and committed by
Thomas Gleixner
decb9ac4 5be63fc1

+1 -1
+1 -1
arch/x86/mm/cpu_entry_area.c
··· 164 164 } 165 165 } 166 166 #else 167 - static inline void percpu_setup_exception_stacks(unsigned int cpu) 167 + static void __init percpu_setup_exception_stacks(unsigned int cpu) 168 168 { 169 169 struct cpu_entry_area *cea = get_cpu_entry_area(cpu); 170 170