From: Ingo Molnar Date: Mon, 7 Nov 2005 08:59:29 +0000 (-0800) Subject: [PATCH] small kernel_stat.h cleanup X-Git-Tag: v2.6.15-rc1~619 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28ef35845f2c8da8e1bed068277d2fab1e8c8979;p=linux-2.6 [PATCH] small kernel_stat.h cleanup cleanup: use for_each_cpu() instead of an open-coded NR_CPUS loop. Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index dba27749b4..a484572c30 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -6,6 +6,7 @@ #include #include #include +#include #include /* @@ -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; }