Skip to content

Commit 9ffa4b3

Browse files
committed
cpumask: add for_each_{possible,online}_cpu_wrap
The iterators are trivial extensions of for_each_cpu_wrap(). They are used in the following patches of the series to replace cpumask_next_wrap(). Signed-off-by: Yury Norov <[email protected]>
1 parent 158e9d2 commit 9ffa4b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/linux/cpumask.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,21 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
10331033
#define for_each_possible_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++)
10341034
#define for_each_online_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++)
10351035
#define for_each_present_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++)
1036+
1037+
#define for_each_possible_cpu_wrap(cpu, start) \
1038+
for ((void)(start), (cpu) = 0; (cpu) < 1; (cpu)++)
1039+
#define for_each_online_cpu_wrap(cpu, start) \
1040+
for ((void)(start), (cpu) = 0; (cpu) < 1; (cpu)++)
10361041
#else
10371042
#define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask)
10381043
#define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask)
10391044
#define for_each_enabled_cpu(cpu) for_each_cpu((cpu), cpu_enabled_mask)
10401045
#define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask)
1046+
1047+
#define for_each_possible_cpu_wrap(cpu, start) \
1048+
for_each_cpu_wrap((cpu), cpu_possible_mask, (start))
1049+
#define for_each_online_cpu_wrap(cpu, start) \
1050+
for_each_cpu_wrap((cpu), cpu_online_mask, (start))
10411051
#endif
10421052

10431053
/* Wrappers for arch boot code to manipulate normally-constant masks */

0 commit comments

Comments
 (0)