1
0
Fork 0

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

commit d0055f351e upstream.

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: 6a4d2657e0 ("x86/smp: Provide topology_is_primary_thread()")
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Vlastimil Babka 2018-08-14 23:38:57 +02:00 committed by Greg Kroah-Hartman
parent e456004eb7
commit 9428a6a0ea
1 changed files with 2 additions and 0 deletions

View File

@ -2094,6 +2094,7 @@ static int cpuid_to_apicid[] = {
[0 ... NR_CPUS - 1] = -1,
};
#ifdef CONFIG_SMP
/**
* apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread
* @id: APIC ID to check
@ -2108,6 +2109,7 @@ bool apic_id_is_primary_thread(unsigned int apicid)
mask = (1U << (fls(smp_num_siblings) - 1)) - 1;
return !(apicid & mask);
}
#endif
/*
* Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids