]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
proc: fixup irq iterator
authorThomas Gleixner <tglx@linutronix.de>
Thu, 16 Oct 2008 12:50:27 +0000 (14:50 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 16 Oct 2008 14:53:30 +0000 (16:53 +0200)
There is no need for irq_desc here. Even for sparse_irq we can
handle this clever in for_each_irq_nr().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/proc/proc_misc.c
include/linux/irq.h

index 3f5c7b9d1a70b5ddce1ae5c266df06e6a8eab3d2..97b4579134d5a214b72df51bd6530b1f40caba65 100644 (file)
@@ -509,9 +509,6 @@ static int show_stat(struct seq_file *p, void *v)
        u64 sum = 0;
        struct timespec boottime;
        unsigned int per_irq_sum;
-#ifdef CONFIG_GENERIC_HARDIRQS
-       struct irq_desc *desc;
-#endif
 
        user = nice = system = idle = iowait =
                irq = softirq = steal = cputime64_zero;
@@ -530,7 +527,7 @@ static int show_stat(struct seq_file *p, void *v)
                steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
                guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
 
-               for_each_irq_desc(j, desc)
+               for_each_irq_nr(j)
                        sum += kstat_irqs_cpu(j, i);
 
                sum += arch_irq_stat_cpu(i);
@@ -575,7 +572,7 @@ static int show_stat(struct seq_file *p, void *v)
        seq_printf(p, "intr %llu", (unsigned long long)sum);
 
        /* sum again ? it could be updated? */
-       for_each_irq_desc(j, desc) {
+       for_each_irq_nr(j) {
                per_irq_sum = 0;
 
                for_each_possible_cpu(i)
index 31632aa65d16a335e5bc03ad651bc53aeb48a6c9..0618fb362cb456103dc10df78ec641cf39b186f2 100644 (file)
@@ -27,6 +27,9 @@ extern int nr_irqs;
             irq > 0; irq--, desc--)
 #endif
 
+#define for_each_irq_nr(irq)                   \
+       for (irq = 0; irq < nr_irqs; irq++)
+
 #ifndef CONFIG_S390
 
 #include <linux/linkage.h>