Skip to content

Commit

Permalink
[PATCH] for_each_possible_cpu: sparc
Browse files Browse the repository at this point in the history
for_each_cpu() actually iterates across all possible CPUs.  We've had mistakes
in the past where people were using for_each_cpu() where they should have been
iterating across only online or present CPUs.  This is inefficient and
possibly buggy.

We're renaming for_each_cpu() to for_each_possible_cpu() to avoid this in the
future.

This patch replaces for_each_cpu with for_each_possible_cpu.

Signed-off-by: KAMEZAWA Hiroyuki <[email protected]>
Acked-by: "David S. Miller" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hkamezawa authored and Linus Torvalds committed Apr 11, 2006
1 parent 6f91204 commit fff8efe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int setup_profiling_timer(unsigned int multiplier)
return -EINVAL;

spin_lock_irqsave(&prof_setup_lock, flags);
for_each_cpu(i) {
for_each_possible_cpu(i) {
load_profile_irq(i, lvl14_resolution / multiplier);
prof_multiplier(i) = multiplier;
}
Expand Down

0 comments on commit fff8efe

Please sign in to comment.