diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2008-12-26 12:24:24 +0900 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-26 09:48:17 +0100 |
commit | f9af0e70911e9d6cc9a68f784dca86415486084d (patch) | |
tree | 58a83c34cc8a511b5e05d48425251621e9b471a1 /include/linux/irqnr.h | |
parent | 51bc39f4ba35bae153b32145077fb1109bcae14c (diff) | |
download | blackbird-op-linux-f9af0e70911e9d6cc9a68f784dca86415486084d.tar.gz blackbird-op-linux-f9af0e70911e9d6cc9a68f784dca86415486084d.zip |
irq: for_each_irq_desc() move to irqnr.h
Impact: cleanup
before CONFIG_SPARSE_IRQ age, for_each_irq_desc() sat in irqnr.h and
could be called from generic code.
CONFIG_SPARSE_IRQ breaks this assumption, but SPARSE_IRQ version
for_each_irq_desc() also can move into irqnr.h easily.
Also, this patch unifies CONFIG_SPARSE_IRQ and !CONFIG_SPARSE_IRQ
for_each_irq_desc().
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/irqnr.h')
-rw-r--r-- | include/linux/irqnr.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 95d2b74641f5..c4a59c7a478b 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h @@ -15,20 +15,19 @@ # define for_each_irq_desc_reverse(irq, desc) \ for (irq = nr_irqs - 1; irq >= 0; irq--) -#else +#else /* CONFIG_GENERIC_HARDIRQS */ extern int nr_irqs; +extern struct irq_desc *irq_to_desc(unsigned int irq); -#ifndef CONFIG_SPARSE_IRQ +# define for_each_irq_desc(irq, desc) \ + for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ + irq++, desc = irq_to_desc(irq)) +# define for_each_irq_desc_reverse(irq, desc) \ + for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ + irq--, desc = irq_to_desc(irq)) -struct irq_desc; -# define for_each_irq_desc(irq, desc) \ - for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) -# define for_each_irq_desc_reverse(irq, desc) \ - for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ - irq >= 0; irq--, desc--) -#endif -#endif +#endif /* CONFIG_GENERIC_HARDIRQS */ #define for_each_irq_nr(irq) \ for (irq = 0; irq < nr_irqs; irq++) |