aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/genx2apic_phys.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/genx2apic_phys.c')
-rw-r--r--arch/x86/kernel/genx2apic_phys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index b255507884f..62895cf315f 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -132,7 +132,9 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
* We're using fixed IRQ delivery, can only return one phys APIC ID.
* May as well be the first.
*/
- cpu = cpumask_any_and(cpumask, andmask);
+ for_each_cpu_and(cpu, cpumask, andmask)
+ if (cpumask_test_cpu(cpu, cpu_online_mask))
+ break;
if (cpu < nr_cpu_ids)
return per_cpu(x86_cpu_to_apicid, cpu);
return BAD_APICID;