summaryrefslogtreecommitdiffstats
path: root/include/linux/kernel_stat.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2005-11-07 00:59:29 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 07:53:37 -0800
commit28ef35845f2c8da8e1bed068277d2fab1e8c8979 (patch)
treed686f9f9e090fe2b88af35bd40aa6f2093d20c01 /include/linux/kernel_stat.h
parenta43313668f62a06e14c915b8c8994fc8a1257394 (diff)
downloadop-kernel-dev-28ef35845f2c8da8e1bed068277d2fab1e8c8979.zip
op-kernel-dev-28ef35845f2c8da8e1bed068277d2fab1e8c8979.tar.gz
[PATCH] small kernel_stat.h cleanup
cleanup: use for_each_cpu() instead of an open-coded NR_CPUS loop. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/kernel_stat.h')
-rw-r--r--include/linux/kernel_stat.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index dba2774..a484572 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -6,6 +6,7 @@
#include <linux/smp.h>
#include <linux/threads.h>
#include <linux/percpu.h>
+#include <linux/cpumask.h>
#include <asm/cputime.h>
/*
@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void);
*/
static inline int kstat_irqs(int irq)
{
- int i, sum=0;
+ int cpu, sum = 0;
- for (i = 0; i < NR_CPUS; i++)
- if (cpu_possible(i))
- sum += kstat_cpu(i).irqs[irq];
+ for_each_cpu(cpu)
+ sum += kstat_cpu(cpu).irqs[irq];
return sum;
}
OpenPOWER on IntegriCloud