]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sparse irqs: handle !GENIRQ platforms
authorIngo Molnar <mingo@elte.hu>
Fri, 12 Dec 2008 10:26:39 +0000 (11:26 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 12 Dec 2008 11:28:50 +0000 (12:28 +0100)
Impact: build fix

fix:

 In file included from /home/mingo/tip/arch/m68k/amiga/amiints.c:39:
 /home/mingo/tip/include/linux/interrupt.h:21: error: expected identifier or '('
 /home/mingo/tip/arch/m68k/amiga/amiints.c: In function 'amiga_init_IRQ':

Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/interrupt.h
include/linux/irqnr.h
include/linux/random.h

index 79e915e7e8a50594f011ec70159a68bf885177d3..777f89e00b4aeef15f14c3b57b18c7cf8e42bb3d 100644 (file)
 #include <linux/irqflags.h>
 #include <linux/smp.h>
 #include <linux/percpu.h>
+#include <linux/irqnr.h>
+
 #include <asm/atomic.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 
-extern int nr_irqs;
-
 /*
  * These correspond to the IORESOURCE_IRQ_* defines in
  * linux/ioport.h to select the interrupt line behaviour.  When
index 13754f8135894a717fc710a1637113ffee756a24..95d2b74641f5dbe2ecb90bb68d430ab600d61b74 100644 (file)
@@ -1,6 +1,11 @@
 #ifndef _LINUX_IRQNR_H
 #define _LINUX_IRQNR_H
 
+/*
+ * Generic irq_desc iterators:
+ */
+#ifdef __KERNEL__
+
 #ifndef CONFIG_GENERIC_HARDIRQS
 #include <asm/irq.h>
 # define nr_irqs               NR_IRQS
 # define for_each_irq_desc_reverse(irq, desc)                          \
        for (irq = nr_irqs - 1; irq >= 0; irq--)
 #else
+
+extern int nr_irqs;
+
 #ifndef CONFIG_SPARSE_IRQ
 
 struct irq_desc;
-extern int nr_irqs;
 # 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)                          \
@@ -26,4 +33,6 @@ extern int nr_irqs;
 #define for_each_irq_nr(irq)                   \
        for (irq = 0; irq < nr_irqs; irq++)
 
+#endif /* __KERNEL__ */
+
 #endif
index ad9daa2374d5258cdfeddb589e81b7c6a7e51bb3..adbf3bd3c6b3c8edea3e313a4abce0a736d02ebf 100644 (file)
@@ -8,6 +8,7 @@
 #define _LINUX_RANDOM_H
 
 #include <linux/ioctl.h>
+#include <linux/irqnr.h>
 
 /* ioctl()'s for the random number generator */
 
@@ -49,7 +50,6 @@ struct timer_rand_state;
 
 extern struct timer_rand_state *irq_timer_state[];
 
-extern int nr_irqs;
 static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq)
 {
        if (irq >= nr_irqs)