]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Fri, 26 Dec 2008 05:24:10 +0000 (14:24 +0900)
committerIngo Molnar <mingo@elte.hu>
Fri, 26 Dec 2008 08:48:18 +0000 (09:48 +0100)
Impact: cleanup

irq_desc can be NULL when CONFIG_SPARSE_IRQ=y only.
therefore, NULL checking can move into kstat_irqs_cpu() of SPARSE_IRQ version.

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>
fs/proc/stat.c
kernel/irq/handle.c

index 3bb1cf1e742552ad2f97b6b6206474937ffb0f07..f75efa22df5ee39eba1e23f4998ed01567e35b8f 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/time.h>
+#include <linux/irqnr.h>
 #include <asm/cputime.h>
 
 #ifndef arch_irq_stat_cpu
@@ -45,10 +46,6 @@ 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_nr(j) {
-#ifdef CONFIG_SPARSE_IRQ
-                       if (!irq_to_desc(j))
-                               continue;
-#endif
                        sum += kstat_irqs_cpu(j, i);
                }
                sum += arch_irq_stat_cpu(i);
@@ -95,12 +92,6 @@ static int show_stat(struct seq_file *p, void *v)
        /* sum again ? it could be updated? */
        for_each_irq_nr(j) {
                per_irq_sum = 0;
-#ifdef CONFIG_SPARSE_IRQ
-               if (!irq_to_desc(j)) {
-                       seq_printf(p, " %u", per_irq_sum);
-                       continue;
-               }
-#endif
                for_each_possible_cpu(i)
                        per_irq_sum += kstat_irqs_cpu(j, i);
 
index 4db7d2df86b62662bc561f4b3fb5f33e60d4c201..03479dfdebb8ff55d82344930e564e3dc6986c9c 100644 (file)
@@ -448,7 +448,7 @@ void early_init_irq_lock_class(void)
 unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
 {
        struct irq_desc *desc = irq_to_desc(irq);
-       return desc->kstat_irqs[cpu];
+       return desc ? desc->kstat_irqs[cpu] : 0;
 }
 #endif
 EXPORT_SYMBOL(kstat_irqs_cpu);