Skip to content

Commit

Permalink
drivers/xen: use nr_irqs
Browse files Browse the repository at this point in the history
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 16, 2008
1 parent da27c11 commit 5a15d7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void init_evtchn_cpu_bindings(void)
#ifdef CONFIG_SMP
int i;
/* By default all event channels notify CPU#0. */
for (i = 0; i < NR_IRQS; i++)
for (i = 0; i < nr_irqs; i++)
irq_desc[i].affinity = cpumask_of_cpu(0);
#endif

Expand Down Expand Up @@ -229,12 +229,12 @@ static int find_unbound_irq(void)
int irq;

/* Only allocate from dynirq range */
for (irq = 0; irq < NR_IRQS; irq++)
for (irq = 0; irq < nr_irqs; irq++)
if (irq_bindcount[irq] == 0)
break;

if (irq == NR_IRQS)
panic("No available IRQ to bind to: increase NR_IRQS!\n");
if (irq == nr_irqs)
panic("No available IRQ to bind to: increase nr_irqs!\n");

return irq;
}
Expand Down Expand Up @@ -790,7 +790,7 @@ void xen_irq_resume(void)
mask_evtchn(evtchn);

/* No IRQ <-> event-channel mappings. */
for (irq = 0; irq < NR_IRQS; irq++)
for (irq = 0; irq < nr_irqs; irq++)
irq_info[irq].evtchn = 0; /* zap event-channel binding */

for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++)
Expand Down Expand Up @@ -822,7 +822,7 @@ void __init xen_init_IRQ(void)
mask_evtchn(i);

/* Dynamic IRQ space is currently unbound. Zero the refcnts. */
for (i = 0; i < NR_IRQS; i++)
for (i = 0; i < nr_irqs; i++)
irq_bindcount[i] = 0;

irq_ctx_init(smp_processor_id());
Expand Down

0 comments on commit 5a15d7e

Please sign in to comment.