]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
irq: simplify for_each_irq_desc() usage
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Fri, 26 Dec 2008 03:29:48 +0000 (12:29 +0900)
committerIngo Molnar <mingo@elte.hu>
Fri, 26 Dec 2008 08:48:18 +0000 (09:48 +0100)
Impact: cleanup

all for_each_irq_desc() usage point have !desc check.
then its check can move into for_each_irq_desc() macro.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/io_apic.c
drivers/xen/events.c
include/linux/irqnr.h
kernel/irq/autoprobe.c
kernel/irq/handle.c
kernel/irq/spurious.c

index a74887b416cc14903ead416aee2585d0c7bb159d..2fe543f58ac807d360b5aacaaa528b4b1da5c5fa 100644 (file)
@@ -1345,8 +1345,6 @@ void __setup_vector_irq(int cpu)
 
        /* Mark the inuse vectors */
        for_each_irq_desc(irq, desc) {
-               if (!desc)
-                       continue;
                cfg = desc->chip_data;
                if (!cpu_isset(cpu, cfg->domain))
                        continue;
@@ -1730,8 +1728,6 @@ __apicdebuginit(void) print_IO_APIC(void)
        for_each_irq_desc(irq, desc) {
                struct irq_pin_list *entry;
 
-               if (!desc)
-                       continue;
                cfg = desc->chip_data;
                entry = cfg->irq_2_pin;
                if (!entry)
@@ -2378,9 +2374,6 @@ static void ir_irq_migration(struct work_struct *work)
        struct irq_desc *desc;
 
        for_each_irq_desc(irq, desc) {
-               if (!desc)
-                       continue;
-
                if (desc->status & IRQ_MOVE_PENDING) {
                        unsigned long flags;
 
@@ -2671,9 +2664,6 @@ static inline void init_IO_APIC_traps(void)
         * 0x80, because int 0x80 is hm, kind of importantish. ;)
         */
        for_each_irq_desc(irq, desc) {
-               if (!desc)
-                       continue;
-
                cfg = desc->chip_data;
                if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) {
                        /*
index 46625cd38743c2506e1fc024c8e1c4d434a4fa26..e26733a9df21d5ca583ad09bea26dfea909873da 100644 (file)
@@ -142,9 +142,6 @@ static void init_evtchn_cpu_bindings(void)
 
        /* By default all event channels notify CPU#0. */
        for_each_irq_desc(i, desc) {
-               if (!desc)
-                       continue;
-
                desc->affinity = cpumask_of_cpu(0);
        }
 #endif
index c4a59c7a478be5c20c1a04bb3d3538846dd262cf..5504a5c97836d9fb4f1fb191cd6a11cdc131c22e 100644 (file)
@@ -22,10 +22,14 @@ extern struct irq_desc *irq_to_desc(unsigned int 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))
+            irq++, desc = irq_to_desc(irq))                            \
+               if (desc)
+
+
 # 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))
+            irq--, desc = irq_to_desc(irq))                            \
+               if (desc)
 
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
index 650ce4102a6333d9ddf097692583e55659a25333..cc0f7321b8cede4192a4ceb9ffc97311ec9cc7d0 100644 (file)
@@ -40,9 +40,6 @@ unsigned long probe_irq_on(void)
         * flush such a longstanding irq before considering it as spurious.
         */
        for_each_irq_desc_reverse(i, desc) {
-               if (!desc)
-                       continue;
-
                spin_lock_irq(&desc->lock);
                if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
                        /*
@@ -71,9 +68,6 @@ unsigned long probe_irq_on(void)
         * happened in the previous stage, it may have masked itself)
         */
        for_each_irq_desc_reverse(i, desc) {
-               if (!desc)
-                       continue;
-
                spin_lock_irq(&desc->lock);
                if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
                        desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
@@ -92,9 +86,6 @@ unsigned long probe_irq_on(void)
         * Now filter out any obviously spurious interrupts
         */
        for_each_irq_desc(i, desc) {
-               if (!desc)
-                       continue;
-
                spin_lock_irq(&desc->lock);
                status = desc->status;
 
@@ -133,9 +124,6 @@ unsigned int probe_irq_mask(unsigned long val)
        int i;
 
        for_each_irq_desc(i, desc) {
-               if (!desc)
-                       continue;
-
                spin_lock_irq(&desc->lock);
                status = desc->status;
 
@@ -178,9 +166,6 @@ int probe_irq_off(unsigned long val)
        unsigned int status;
 
        for_each_irq_desc(i, desc) {
-               if (!desc)
-                       continue;
-
                spin_lock_irq(&desc->lock);
                status = desc->status;
 
index 03479dfdebb8ff55d82344930e564e3dc6986c9c..7dbdfe52469345af409da26298f278b2aeb71a99 100644 (file)
@@ -437,9 +437,6 @@ void early_init_irq_lock_class(void)
        int i;
 
        for_each_irq_desc(i, desc) {
-               if (!desc)
-                       continue;
-
                lockdep_set_class(&desc->lock, &irq_desc_lock_class);
        }
 }
index 3738107531fd29190b62e628d4d7da8f1081ec96..dd364c11e56e0f82e0e923fcc3b60d17524e991d 100644 (file)
@@ -91,9 +91,6 @@ static int misrouted_irq(int irq)
        int i, ok = 0;
 
        for_each_irq_desc(i, desc) {
-               if (!desc)
-                       continue;
-
                if (!i)
                         continue;
 
@@ -115,8 +112,6 @@ static void poll_spurious_irqs(unsigned long dummy)
        for_each_irq_desc(i, desc) {
                unsigned int status;
 
-               if (!desc)
-                       continue;
                if (!i)
                         continue;