summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-01-18 18:30:55 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-18 18:30:55 -0800
commit012061cc70e9c7e0d794a3e609fd79fdf9f5267d (patch)
treea1a1cee6d1e7b4576a7ee148e297c04936388402 /kernel/fork.c
parent90c7f71962cc5aa0bf128ce68b9a8607176558c4 (diff)
[PATCH] Use for_each_cpu() Where It's Meant To Be
From: Rusty Russell <rusty@rustcorp.com.au> Some places use cpu_online() where they should be using cpu_possible, most commonly for tallying statistics. This makes no difference without hotplug CPU. Use the for_each_cpu() macro in those places, providing good examples (and making the external hotplug CPU patch smaller). Some places use cpu_online() where they should be using cpu_possible, most commonly for tallying statistics. This makes no difference without hotplug CPU. Use the for_each_cpu() macro in those places, providing good examples (and making the external hotplug CPU patch smaller).
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index b9a13609b635..ea2eeb1ed644 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -60,10 +60,9 @@ int nr_processes(void)
int cpu;
int total = 0;
- for (cpu = 0; cpu < NR_CPUS; cpu++) {
- if (cpu_online(cpu))
- total += per_cpu(process_counts, cpu);
- }
+ for_each_cpu(cpu)
+ total += per_cpu(process_counts, cpu);
+
return total;
}