diff options
Diffstat (limited to 'include/linux/irqnr.h')
-rw-r--r-- | include/linux/irqnr.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 95d2b74641f5..5504a5c97836 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -15,20 +15,23 @@ | |||
15 | 15 | ||
16 | # define for_each_irq_desc_reverse(irq, desc) \ | 16 | # define for_each_irq_desc_reverse(irq, desc) \ |
17 | for (irq = nr_irqs - 1; irq >= 0; irq--) | 17 | for (irq = nr_irqs - 1; irq >= 0; irq--) |
18 | #else | 18 | #else /* CONFIG_GENERIC_HARDIRQS */ |
19 | 19 | ||
20 | extern int nr_irqs; | 20 | extern int nr_irqs; |
21 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
21 | 22 | ||
22 | #ifndef CONFIG_SPARSE_IRQ | 23 | # define for_each_irq_desc(irq, desc) \ |
24 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ | ||
25 | irq++, desc = irq_to_desc(irq)) \ | ||
26 | if (desc) | ||
23 | 27 | ||
24 | struct irq_desc; | 28 | |
25 | # define for_each_irq_desc(irq, desc) \ | 29 | # define for_each_irq_desc_reverse(irq, desc) \ |
26 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) | 30 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ |
27 | # define for_each_irq_desc_reverse(irq, desc) \ | 31 | irq--, desc = irq_to_desc(irq)) \ |
28 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ | 32 | if (desc) |
29 | irq >= 0; irq--, desc--) | 33 | |
30 | #endif | 34 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
31 | #endif | ||
32 | 35 | ||
33 | #define for_each_irq_nr(irq) \ | 36 | #define for_each_irq_nr(irq) \ |
34 | for (irq = 0; irq < nr_irqs; irq++) | 37 | for (irq = 0; irq < nr_irqs; irq++) |