summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2023-06-15 09:21:18 -0700
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2023-06-20 14:30:59 +0200
commit6e6251317c962b7c15ad2d8591f3103990c80701 (patch)
treef0319479cdc18f7b34da0e98413398e9fe4dfdc0 /arch/mips
parent13e6b8122d448b07d16a3d9c0d0ab41d00a3f284 (diff)
MIPS: Mark core_vpe_count() as __init
After commit 96cb8ae28c65 ("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: 96cb8ae28c65 ("MIPS: Rework smt cmdline parameters") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/smp-cps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index bea6a13ea464..92575222713b 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -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));
}