mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
cpumask: Introduce for_each_cpu_andnot()
for_each_cpu_and() is very convenient as it saves having to allocate a temporary cpumask to store the result of cpumask_and(). The same issue applies to cpumask_andnot() which doesn't actually need temporary storage for iteration purposes. Following what has been done for for_each_cpu_and(), introduce for_each_cpu_andnot(). Signed-off-by: Valentin Schneider <vschneid@redhat.com>
This commit is contained in:
committed by
Yury Norov
parent
90d482908e
commit
5f75ff295c
@@ -498,6 +498,11 @@ unsigned long find_next_bit_le(const void *addr, unsigned
|
||||
(bit) = find_next_and_bit((addr1), (addr2), (size), (bit)), (bit) < (size);\
|
||||
(bit)++)
|
||||
|
||||
#define for_each_andnot_bit(bit, addr1, addr2, size) \
|
||||
for ((bit) = 0; \
|
||||
(bit) = find_next_andnot_bit((addr1), (addr2), (size), (bit)), (bit) < (size);\
|
||||
(bit)++)
|
||||
|
||||
/* same as for_each_set_bit() but use bit as value to start with */
|
||||
#define for_each_set_bit_from(bit, addr, size) \
|
||||
for (; (bit) = find_next_bit((addr), (size), (bit)), (bit) < (size); (bit)++)
|
||||
|
||||
Reference in New Issue
Block a user