summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/bitops.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2017-02-25 14:16:31 +0300
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-03-22 10:29:01 +0300
commit09214545c4a40943ecb6cedc511cd4bd709c85a6 (patch)
tree839696e1ad8d39d7c1a72e50ceeec53cb892319f /arch/s390/include/asm/bitops.h
parentbffc880b451f1e440efe1b8bd3af365018ec314a (diff)
downloadlinux-09214545c4a40943ecb6cedc511cd4bd709c85a6.tar.xz
s390/bitops: add for_each_set_bit_inv helper
Same helper function like for_each_set_bit in generic code. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/bitops.h')
-rw-r--r--arch/s390/include/asm/bitops.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index d92047da5ccb..e7a185407182 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -253,6 +253,11 @@ unsigned long find_first_bit_inv(const unsigned long *addr, unsigned long size);
unsigned long find_next_bit_inv(const unsigned long *addr, unsigned long size,
unsigned long offset);
+#define for_each_set_bit_inv(bit, addr, size) \
+ for ((bit) = find_first_bit_inv((addr), (size)); \
+ (bit) < (size); \
+ (bit) = find_next_bit_inv((addr), (size), (bit) + 1))
+
static inline void set_bit_inv(unsigned long nr, volatile unsigned long *ptr)
{
return set_bit(nr ^ (BITS_PER_LONG - 1), ptr);