aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-10-16 08:19:04 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:53:30 -0400
commit10e580842ec8e53dddf62e1ab1871f4906477376 (patch)
tree5793b45755f21f578ff4b06a3a3546b3de5eb8f4 /drivers
parent2be3b52a5785a6a5c5349fbd315f57595f7074be (diff)
genirq: use iterators for irq_desc loops
Use for_each_irq_desc[_reverse] for all the iteration loops. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/events.c14
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)
137static void init_evtchn_cpu_bindings(void) 137static 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());