[PATCH] small kernel_stat.h cleanup
authorIngo Molnar <mingo@elte.hu>
Mon, 7 Nov 2005 08:59:29 +0000 (00:59 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 7 Nov 2005 15:53:37 +0000 (07:53 -0800)
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>
include/linux/kernel_stat.h

index dba27749b428368f159a91666797c218bfd60521..a484572c302e10fd43a81aa3cdffd9c2be6eb07b 100644 (file)
@@ -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;
 }