Skip to content

Commit 2a4a408

Browse files
Alexey Dobriyantorvalds
authored andcommitted
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@avx2 Signed-off-by: Alexey Dobriyan <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8495f7e commit 2a4a408

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/linux/cpumask.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node)
200200
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
201201
#define for_each_cpu_wrap(cpu, mask, start) \
202202
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))
203-
#define for_each_cpu_and(cpu, mask, and) \
204-
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and)
203+
#define for_each_cpu_and(cpu, mask1, mask2) \
204+
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask1, (void)mask2)
205205
#else
206206
/**
207207
* 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
290290
/**
291291
* for_each_cpu_and - iterate over every cpu in both masks
292292
* @cpu: the (optionally unsigned) integer iterator
293-
* @mask: the first cpumask pointer
294-
* @and: the second cpumask pointer
293+
* @mask1: the first cpumask pointer
294+
* @mask2: the second cpumask pointer
295295
*
296296
* This saves a temporary CPU mask in many places. It is equivalent to:
297297
* struct cpumask tmp;
298-
* cpumask_and(&tmp, &mask, &and);
298+
* cpumask_and(&tmp, &mask1, &mask2);
299299
* for_each_cpu(cpu, &tmp)
300300
* ...
301301
*
302302
* After the loop, cpu is >= nr_cpu_ids.
303303
*/
304-
#define for_each_cpu_and(cpu, mask, and) \
304+
#define for_each_cpu_and(cpu, mask1, mask2) \
305305
for ((cpu) = -1; \
306-
(cpu) = cpumask_next_and((cpu), (mask), (and)), \
306+
(cpu) = cpumask_next_and((cpu), (mask1), (mask2)), \
307307
(cpu) < nr_cpu_ids;)
308308
#endif /* SMP */
309309

0 commit comments

Comments
 (0)