diff options
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r-- | drivers/xen/events.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index e6d47e8ca1ac..9ce1ab6c268d 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -137,14 +137,12 @@ static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu) | |||
137 | static void init_evtchn_cpu_bindings(void) | 137 | static void init_evtchn_cpu_bindings(void) |
138 | { | 138 | { |
139 | #ifdef CONFIG_SMP | 139 | #ifdef CONFIG_SMP |
140 | struct irq_desc *desc; | ||
140 | int i; | 141 | int i; |
142 | |||
141 | /* By default all event channels notify CPU#0. */ | 143 | /* By default all event channels notify CPU#0. */ |
142 | for (i = 0; i < nr_irqs; i++) { | 144 | for_each_irq_desc(i, desc) |
143 | struct irq_desc *desc = irq_to_desc(i); | ||
144 | if (!desc) | ||
145 | continue; | ||
146 | desc->affinity = cpumask_of_cpu(0); | 145 | desc->affinity = cpumask_of_cpu(0); |
147 | } | ||
148 | #endif | 146 | #endif |
149 | 147 | ||
150 | memset(cpu_evtchn, 0, sizeof(cpu_evtchn)); | 148 | memset(cpu_evtchn, 0, sizeof(cpu_evtchn)); |
@@ -233,7 +231,7 @@ static int find_unbound_irq(void) | |||
233 | int irq; | 231 | int irq; |
234 | 232 | ||
235 | /* Only allocate from dynirq range */ | 233 | /* Only allocate from dynirq range */ |
236 | for (irq = 0; irq < nr_irqs; irq++) | 234 | for_each_irq_nr(irq) |
237 | if (irq_bindcount[irq] == 0) | 235 | if (irq_bindcount[irq] == 0) |
238 | break; | 236 | break; |
239 | 237 | ||
@@ -794,7 +792,7 @@ void xen_irq_resume(void) | |||
794 | mask_evtchn(evtchn); | 792 | mask_evtchn(evtchn); |
795 | 793 | ||
796 | /* No IRQ <-> event-channel mappings. */ | 794 | /* No IRQ <-> event-channel mappings. */ |
797 | for (irq = 0; irq < nr_irqs; irq++) | 795 | for_each_irq_nr(irq) |
798 | irq_info[irq].evtchn = 0; /* zap event-channel binding */ | 796 | irq_info[irq].evtchn = 0; /* zap event-channel binding */ |
799 | 797 | ||
800 | for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++) | 798 | for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++) |
@@ -826,7 +824,7 @@ void __init xen_init_IRQ(void) | |||
826 | mask_evtchn(i); | 824 | mask_evtchn(i); |
827 | 825 | ||
828 | /* Dynamic IRQ space is currently unbound. Zero the refcnts. */ | 826 | /* Dynamic IRQ space is currently unbound. Zero the refcnts. */ |
829 | for (i = 0; i < nr_irqs; i++) | 827 | for_each_irq_nr(i) |
830 | irq_bindcount[i] = 0; | 828 | irq_bindcount[i] = 0; |
831 | 829 | ||
832 | irq_ctx_init(smp_processor_id()); | 830 | irq_ctx_init(smp_processor_id()); |