From fb325f924c9bfccba59ed8789a684df537872f89 Mon Sep 17 00:00:00 2001 From: xubo <1050282246@qq.com> Date: Wed, 1 Jul 2026 15:50:34 +0800 Subject: [PATCH] arm64: fix compilation errors when CONFIG_ACPI is disabled When CONFIG_ACPI is not enabled, the compilation fails in smp_prepare_cpus() because cpu_madt_gicc[] array is only defined inside the CONFIG_ACPI ifdef block, but is referenced unconditionally in the else branch of acpi_disabled check. Fix this by wrapping the ACPI-specific code with #ifdef CONFIG_ACPI and providing a non-ACPI alternative that unconditionally sets the CPU present. Fixes: e2ac98873be0c48 ("virt: phytium: Add ARM64support for CPU hotplug") Signed-off-by: xubo <1050282246@qq.com> --- arch/arm64/kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 7c96748e5c..6209239805 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -750,12 +750,16 @@ void __init smp_prepare_cpus(unsigned int max_cpus) if (err) continue; +#ifdef CONFIG_ACPI if (acpi_disabled) { set_cpu_present(cpu, true); } else { if ((cpu_madt_gicc[cpu].flags & ACPI_MADT_ENABLED)) set_cpu_present(cpu, true); } +#else + set_cpu_present(cpu, true); +#endif numa_store_cpu_info(cpu); } -- Gitee