arch/powerpc: provide zero_bytemask() for big-endian
authorChris Metcalf <cmetcalf@ezchip.com>
Wed, 7 Oct 2015 13:29:11 +0000 (09:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 16:30:13 +0000 (09:30 -0700)
commit 7a5692e6e533fd379081ab06fb58f3f5ee4d80bc upstream.

For some reason, only the little-endian flavor of
powerpc provided the zero_bytemask() implementation.

Reported-by: Michal Sojka <sojkam1@fel.cvut.cz>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/word-at-a-time.h

index 7043539e0248458c57909a78c46f6b320805fef3..4afe66aa1400d5d7e3783e696a0a1de12d3a316c 100644 (file)
@@ -40,6 +40,11 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct
        return (val + c->high_bits) & ~rhs;
 }
 
+static inline unsigned long zero_bytemask(unsigned long mask)
+{
+       return ~1ul << __fls(mask);
+}
+
 #else
 
 #ifdef CONFIG_64BIT