Commit 26ddd8d5cac8a563953d5febe8c6e40909f7bce1

Authored by KOSAKI Motohiro
Committed by Ingo Molnar
1 parent f9af0e7091

proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c

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>

Showing 2 changed files with 2 additions and 11 deletions Side-by-side Diff

... ... @@ -9,6 +9,7 @@
9 9 #include <linux/seq_file.h>
10 10 #include <linux/slab.h>
11 11 #include <linux/time.h>
  12 +#include <linux/irqnr.h>
12 13 #include <asm/cputime.h>
13 14  
14 15 #ifndef arch_irq_stat_cpu
... ... @@ -45,10 +46,6 @@
45 46 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
46 47 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
47 48 for_each_irq_nr(j) {
48   -#ifdef CONFIG_SPARSE_IRQ
49   - if (!irq_to_desc(j))
50   - continue;
51   -#endif
52 49 sum += kstat_irqs_cpu(j, i);
53 50 }
54 51 sum += arch_irq_stat_cpu(i);
... ... @@ -95,12 +92,6 @@
95 92 /* sum again ? it could be updated? */
96 93 for_each_irq_nr(j) {
97 94 per_irq_sum = 0;
98   -#ifdef CONFIG_SPARSE_IRQ
99   - if (!irq_to_desc(j)) {
100   - seq_printf(p, " %u", per_irq_sum);
101   - continue;
102   - }
103   -#endif
104 95 for_each_possible_cpu(i)
105 96 per_irq_sum += kstat_irqs_cpu(j, i);
106 97  
... ... @@ -448,7 +448,7 @@
448 448 unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
449 449 {
450 450 struct irq_desc *desc = irq_to_desc(irq);
451   - return desc->kstat_irqs[cpu];
  451 + return desc ? desc->kstat_irqs[cpu] : 0;
452 452 }
453 453 #endif
454 454 EXPORT_SYMBOL(kstat_irqs_cpu);