aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2005-11-07 03:59:29 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:37 -0500
commit28ef35845f2c8da8e1bed068277d2fab1e8c8979 (patch)
treed686f9f9e090fe2b88af35bd40aa6f2093d20c01
parenta43313668f62a06e14c915b8c8994fc8a1257394 (diff)
[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>
-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 dba27749b428..a484572c302e 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -6,6 +6,7 @@
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/threads.h> 7#include <linux/threads.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/cpumask.h>
9#include <asm/cputime.h> 10#include <asm/cputime.h>
10 11
11/* 12/*
@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void);
43 */ 44 */
44static inline int kstat_irqs(int irq) 45static inline int kstat_irqs(int irq)
45{ 46{
46 int i, sum=0; 47 int cpu, sum = 0;
47 48
48 for (i = 0; i < NR_CPUS; i++) 49 for_each_cpu(cpu)
49 if (cpu_possible(i)) 50 sum += kstat_cpu(cpu).irqs[irq];
50 sum += kstat_cpu(i).irqs[irq];
51 51
52 return sum; 52 return sum;
53} 53}