Skip to content

Commit

Permalink
[PATCH] for_each_possible_cpu: defines for_each_possible_cpu
Browse files Browse the repository at this point in the history
for_each_cpu() is a for-loop over cpu_possible_map.  for_each_online_cpu is
for-loop cpu over cpu_online_map.  .....for_each_cpu() is not sufficiently
explicit and can lead to mistakes.

This patch adds for_each_possible_cpu() in preparation for the removal of
for_each_cpu().

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Mar 28, 2006
1 parent 68c3431 commit 631d674
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/cpumask.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
*
* int any_online_cpu(mask) First online cpu in mask
*
* for_each_cpu(cpu) for-loop cpu over cpu_possible_map
* for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map
* for_each_online_cpu(cpu) for-loop cpu over cpu_online_map
* for_each_present_cpu(cpu) for-loop cpu over cpu_present_map
*
Expand Down Expand Up @@ -405,7 +405,8 @@ int __any_online_cpu(const cpumask_t *mask);
#define any_online_cpu(mask) 0
#endif

#define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
#define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
#define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map)
#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)

Expand Down

0 comments on commit 631d674

Please sign in to comment.