Skip to content

Commit

Permalink
proc: fixup irq iterator
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Oct 16, 2008
1 parent 811410f commit 2be3b52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 2be3b52

Please sign in to comment.