From: Vlastimil Babka <vbabka@suse.cz>
Date: Tue, 14 Aug 2018 23:38:57 +0200
Subject: x86/smp: fix non-SMP broken build due to redefinition of
apic_id_is_primary_thread
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: d0055f351e647f33f3b0329bff022213bf8aa085
Patch-mainline: v4.19-rc1
References: bsc#1110006
The function has an inline "return false;" definition with CONFIG_SMP=n
but the "real" definition is also visible leading to "redefinition of
‘apic_id_is_primary_thread’" compiler error.
Guard it with #ifdef CONFIG_SMP
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Fixes: 6a4d2657e048 ("x86/smp: Provide topology_is_primary_thread()")
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Joerg Roedel <jroedel@suse.de>
---
arch/x86/kernel/apic/apic.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2255,6 +2255,7 @@ static void __init apic_bsp_up_setup(voi
physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
}
+#ifdef CONFIG_SMP
/**
* apic_bsp_setup - Setup function for local apic and io-apic
* @upmode: Force UP mode (for APIC_init_uniprocessor)
@@ -2284,6 +2285,7 @@ int __init apic_bsp_setup(bool upmode)
x86_init.timers.setup_percpu_clockev();
return id;
}
+#endif
/*
* This initializes the IO-APIC and APIC hardware if this is