diff options
author | Kyle Meyer <kyle.meyer@hpe.com> | 2024-04-11 00:33:10 +0300 |
---|---|---|
committer | Yury Norov <yury.norov@gmail.com> | 2024-05-09 19:25:08 +0300 |
commit | 6802f9347993a534797847f627c27f4334067945 (patch) | |
tree | e8adb8157a3b15a2e6df458b2f63a16ea86cbd99 | |
parent | 678e14c772130d3a83225ed56fb9860a40bca38b (diff) | |
download | linux-6802f9347993a534797847f627c27f4334067945.tar.xz |
cpumask: Add for_each_cpu_from()
Add for_each_cpu_from() as a generic cpumask macro.
for_each_cpu_from() is the same as for_each_cpu(), except it starts at
@cpu instead of zero.
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
Acked-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
-rw-r--r-- | include/linux/cpumask.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 1c29947db848..d75060fbd058 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -369,6 +369,16 @@ unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int sta for_each_or_bit(cpu, cpumask_bits(mask1), cpumask_bits(mask2), small_cpumask_bits) /** + * for_each_cpu_from - iterate over CPUs present in @mask, from @cpu to the end of @mask. + * @cpu: the (optionally unsigned) integer iterator + * @mask: the cpumask pointer + * + * After the loop, cpu is >= nr_cpu_ids. + */ +#define for_each_cpu_from(cpu, mask) \ + for_each_set_bit_from(cpu, cpumask_bits(mask), small_cpumask_bits) + +/** * cpumask_any_but - return a "random" in a cpumask, but not this one. * @mask: the cpumask to search * @cpu: the cpu to ignore. |