From: H. Peter Anvin Date: Wed, 30 Apr 2014 21:22:19 +0000 (-0700) Subject: word-at-a-time: simplify big-endian zero_bytemask macro X-Git-Tag: firefly_0821_release~176^2~3973 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=789ce9dca8007ab5d7c72b9a174a29243817ac32;p=firefly-linux-kernel-4.4.55.git word-at-a-time: simplify big-endian zero_bytemask macro This is simpler and cleaner. Depending on architecture, a smart compiler may or may not generate the same code. Acked-by: Will Deacon Signed-off-by: Linus Torvalds --- diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h index d96deb443f18..94f9ea8abcae 100644 --- a/include/asm-generic/word-at-a-time.h +++ b/include/asm-generic/word-at-a-time.h @@ -50,7 +50,7 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct } #ifndef zero_bytemask -#define zero_bytemask(mask) (~0ul << __fls(mask) << 1) +#define zero_bytemask(mask) (~1ul << __fls(mask)) #endif #endif /* _ASM_WORD_AT_A_TIME_H */