2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-19 08:05:27 +08:00

[PATCH] for_each_possible_cpu: defines for_each_possible_cpu

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>
This commit is contained in:
KAMEZAWA Hiroyuki 2006-03-28 01:56:36 -08:00 committed by Linus Torvalds
parent 68c3431ae2
commit 631d6747e1

View File

@ -67,7 +67,7 @@
* *
* int any_online_cpu(mask) First online cpu in mask * 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_online_cpu(cpu) for-loop cpu over cpu_online_map
* for_each_present_cpu(cpu) for-loop cpu over cpu_present_map * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map
* *
@ -406,6 +406,7 @@ int __any_online_cpu(const cpumask_t *mask);
#endif #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_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) #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)