summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@ezchip.com>2015-10-07 09:29:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-11 09:30:13 -0700
commitd9110554bb83c5ff13d5d3b6014694339613d594 (patch)
treeb9073e4cd0c34c1f738d290c694ae3dad8e21c1b /arch
parentfa66daa2a6f8fe305e3c2e8a513d051f31a78847 (diff)
arch/powerpc: provide zero_bytemask() for big-endian
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/word-at-a-time.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h
index 7043539e0248..4afe66aa1400 100644
--- a/arch/powerpc/include/asm/word-at-a-time.h
+++ b/arch/powerpc/include/asm/word-at-a-time.h
@@ -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