Commit d0055f35 authored by Vlastimil Babka's avatar Vlastimil Babka Committed by Linus Torvalds

x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread

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: default avatarVlastimil Babka <vbabka@suse.cz>
Fixes: 6a4d2657 ("x86/smp: Provide topology_is_primary_thread()")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 269777aa
...@@ -2193,6 +2193,7 @@ static int cpuid_to_apicid[] = { ...@@ -2193,6 +2193,7 @@ static int cpuid_to_apicid[] = {
[0 ... NR_CPUS - 1] = -1, [0 ... NR_CPUS - 1] = -1,
}; };
#ifdef CONFIG_SMP
/** /**
* apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread
* @id: APIC ID to check * @id: APIC ID to check
...@@ -2207,6 +2208,7 @@ bool apic_id_is_primary_thread(unsigned int apicid) ...@@ -2207,6 +2208,7 @@ bool apic_id_is_primary_thread(unsigned int apicid)
mask = (1U << (fls(smp_num_siblings) - 1)) - 1; mask = (1U << (fls(smp_num_siblings) - 1)) - 1;
return !(apicid & mask); return !(apicid & mask);
} }
#endif
/* /*
* Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids * Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids
......
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