arch/powerpc: provide zero_bytemask() for big-endian
authorChris Metcalf <cmetcalf@ezchip.com>
Wed, 7 Oct 2015 13:29:11 +0000 (09:29 -0400)
committerChris Metcalf <cmetcalf@ezchip.com>
Thu, 8 Oct 2015 15:44:12 +0000 (11:44 -0400)
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>
arch/powerpc/include/asm/word-at-a-time.h

index 5b3a903..e4396a7 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