MIPS: Mark check_bugs() as __init
authorNathan Chancellor <nathan@kernel.org>
Fri, 21 Apr 2023 16:11:26 +0000 (09:11 -0700)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Sat, 22 Apr 2023 21:28:35 +0000 (23:28 +0200)
commit95b5baf81001a80a8dd8b35306694db163bcb423
tree5964341d6af5b7bb89401876d9f6a7ca6d8c2042
parent20470a68a049de3b118e31ab01474c622934c500
MIPS: Mark check_bugs() as __init

After commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), a compiler may choose not to inline a function marked with
just 'inline'. If check_bugs() is not inlined into start_kernel(), which
occurs when building with clang after commit 9ea7e6b62c2b ("init: Mark
[arch_call_]rest_init() __noreturn"), modpost complains with:

  WARNING: modpost: vmlinux.o: section mismatch in reference: check_bugs (section: .text) -> check_bugs32 (section: .init.text)

check_bugs() is only called from start_kernel(), which itself is marked
__init, so there would not be any issues at run time. Make it obvious to
modpost that this call chain is safe by marking check_bugs() as __init,
which fixes the warning.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Link: https://lore.kernel.org/CA+G9fYt+4e57Gdy6cix=LeNK6XqWoui8du=mZWu=cf8vPYocKw@mail.gmail.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/bugs.h