Commit 6e625131 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Thomas Bogendoerfer

MIPS: Mark core_vpe_count() as __init

After commit 96cb8ae2 ("MIPS: Rework smt cmdline parameters"),
modpost complains when building with clang:

  WARNING: modpost: vmlinux.o: section mismatch in reference: core_vpe_count (section: .text) -> smp_max_threads (section: .init.data)

This warning occurs when core_vpe_count() is not inlined, as it appears
that a non-init function is referring to an init symbol. However, this
is not a problem in practice because core_vpe_count() is only called
from __init functions, cps_smp_setup() and cps_prepare_cpus().

Resolve the warning by marking core_vpe_count() as __init, as it is only
called in an init context so it can refer to init functions and symbols
and have its memory freed on boot.

Fixes: 96cb8ae2 ("MIPS: Rework smt cmdline parameters")
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 13e6b812
......@@ -29,7 +29,7 @@ static DECLARE_BITMAP(core_power, NR_CPUS);
struct core_boot_config *mips_cps_core_bootcfg;
static unsigned core_vpe_count(unsigned int cluster, unsigned core)
static unsigned __init core_vpe_count(unsigned int cluster, unsigned core)
{
return min(smp_max_threads, mips_cps_numvps(cluster, core));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment