Commit 28ef3584 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] small kernel_stat.h cleanup

cleanup: use for_each_cpu() instead of an open-coded NR_CPUS loop.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a4331366
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/cpumask.h>
#include <asm/cputime.h> #include <asm/cputime.h>
/* /*
...@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void); ...@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void);
*/ */
static inline int kstat_irqs(int irq) static inline int kstat_irqs(int irq)
{ {
int i, sum=0; int cpu, sum = 0;
for (i = 0; i < NR_CPUS; i++) for_each_cpu(cpu)
if (cpu_possible(i)) sum += kstat_cpu(cpu).irqs[irq];
sum += kstat_cpu(i).irqs[irq];
return sum; return sum;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment