summaryrefslogtreecommitdiffstats
path: root/include/linux/cpumask.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2019-09-25 19:47:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-25 20:51:40 -0400
commit2a4a4082cd4438333b5ecffdd15d1a484e5a83c7 (patch)
tree21b59e6942e3ba42a01b61a53f3433bb75608a56 /include/linux/cpumask.h
parent8495f7e6732ed248b648d36439795b42ec650b9e (diff)
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 <adobriyan@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cpumask.h')
-rw-r--r--include/linux/cpumask.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index b5a5a1ed9efd..78a73eba64dd 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -200,8 +200,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node)
200 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) 200 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
201#define for_each_cpu_wrap(cpu, mask, start) \ 201#define for_each_cpu_wrap(cpu, mask, start) \
202 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start)) 202 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))
203#define for_each_cpu_and(cpu, mask, and) \ 203#define for_each_cpu_and(cpu, mask1, mask2) \
204 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) 204 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask1, (void)mask2)
205#else 205#else
206/** 206/**
207 * cpumask_first - get the first cpu in a cpumask 207 * 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/** 290/**
291 * for_each_cpu_and - iterate over every cpu in both masks 291 * for_each_cpu_and - iterate over every cpu in both masks
292 * @cpu: the (optionally unsigned) integer iterator 292 * @cpu: the (optionally unsigned) integer iterator
293 * @mask: the first cpumask pointer 293 * @mask1: the first cpumask pointer
294 * @and: the second cpumask pointer 294 * @mask2: the second cpumask pointer
295 * 295 *
296 * This saves a temporary CPU mask in many places. It is equivalent to: 296 * This saves a temporary CPU mask in many places. It is equivalent to:
297 * struct cpumask tmp; 297 * struct cpumask tmp;
298 * cpumask_and(&tmp, &mask, &and); 298 * cpumask_and(&tmp, &mask1, &mask2);
299 * for_each_cpu(cpu, &tmp) 299 * for_each_cpu(cpu, &tmp)
300 * ... 300 * ...
301 * 301 *
302 * After the loop, cpu is >= nr_cpu_ids. 302 * After the loop, cpu is >= nr_cpu_ids.
303 */ 303 */
304#define for_each_cpu_and(cpu, mask, and) \ 304#define for_each_cpu_and(cpu, mask1, mask2) \
305 for ((cpu) = -1; \ 305 for ((cpu) = -1; \
306 (cpu) = cpumask_next_and((cpu), (mask), (and)), \ 306 (cpu) = cpumask_next_and((cpu), (mask1), (mask2)), \
307 (cpu) < nr_cpu_ids;) 307 (cpu) < nr_cpu_ids;)
308#endif /* SMP */ 308#endif /* SMP */
309 309