Commit 2a4a4082 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

cpumask: nicer for_each_cpumask_and() signature

Mask arguments can be swapped without changing anything.  Make arguments
names reflect that:

	#define for_each_cpu_and(cpu, mask1, mask2)

Link: http://lkml.kernel.org/r/20190724183350.GA15041@avx2Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8495f7e6
...@@ -200,8 +200,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node) ...@@ -200,8 +200,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node)
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
#define for_each_cpu_wrap(cpu, mask, start) \ #define for_each_cpu_wrap(cpu, mask, start) \
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start)) for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))
#define for_each_cpu_and(cpu, mask, and) \ #define for_each_cpu_and(cpu, mask1, mask2) \
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask1, (void)mask2)
#else #else
/** /**
* cpumask_first - get the first cpu in a cpumask * cpumask_first - get the first cpu in a cpumask
...@@ -290,20 +290,20 @@ extern int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool ...@@ -290,20 +290,20 @@ extern int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool
/** /**
* for_each_cpu_and - iterate over every cpu in both masks * for_each_cpu_and - iterate over every cpu in both masks
* @cpu: the (optionally unsigned) integer iterator * @cpu: the (optionally unsigned) integer iterator
* @mask: the first cpumask pointer * @mask1: the first cpumask pointer
* @and: the second cpumask pointer * @mask2: the second cpumask pointer
* *
* This saves a temporary CPU mask in many places. It is equivalent to: * This saves a temporary CPU mask in many places. It is equivalent to:
* struct cpumask tmp; * struct cpumask tmp;
* cpumask_and(&tmp, &mask, &and); * cpumask_and(&tmp, &mask1, &mask2);
* for_each_cpu(cpu, &tmp) * for_each_cpu(cpu, &tmp)
* ... * ...
* *
* After the loop, cpu is >= nr_cpu_ids. * After the loop, cpu is >= nr_cpu_ids.
*/ */
#define for_each_cpu_and(cpu, mask, and) \ #define for_each_cpu_and(cpu, mask1, mask2) \
for ((cpu) = -1; \ for ((cpu) = -1; \
(cpu) = cpumask_next_and((cpu), (mask), (and)), \ (cpu) = cpumask_next_and((cpu), (mask1), (mask2)), \
(cpu) < nr_cpu_ids;) (cpu) < nr_cpu_ids;)
#endif /* SMP */ #endif /* SMP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment