From: Heiko Carstens Date: Sat, 25 Feb 2017 11:16:31 +0000 (+0100) Subject: s390/bitops: add for_each_set_bit_inv helper X-Git-Tag: v4.14-rc1~1035^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09214545c4a40943ecb6cedc511cd4bd709c85a6;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index d92047d..e7a1854 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);