*/
static int setup_affinity(unsigned int irq, struct irq_desc *desc)
{
+ struct cpumask *set = irq_default_affinity;
+
/* Excludes PER_CPU and NO_BALANCE interrupts */
if (!irq_can_set_affinity(irq))
return 0;
* one of the targets is online.
*/
if (desc->status & (IRQ_AFFINITY_SET)) {
- if (cpumask_any_and(desc->irq_data.affinity, cpu_online_mask)
- < nr_cpu_ids)
- goto set_affinity;
+ if (cpumask_intersects(desc->irq_data.affinity,
+ cpu_online_mask))
+ set = desc->irq_data.affinity;
else
desc->status &= ~IRQ_AFFINITY_SET;
}
-
- cpumask_and(desc->irq_data.affinity, cpu_online_mask, irq_default_affinity);
-set_affinity:
+ cpumask_and(desc->irq_data.affinity, cpu_online_mask, set);
desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false);
return 0;