summaryrefslogtreecommitdiff
path: root/include/linux/bitops.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2017-09-19 16:12:47 +0300
committerMark Brown <broonie@kernel.org>2017-09-19 16:12:47 +0300
commite9331ee9b164d58b4dd0abc882ba7e23d2f404b3 (patch)
tree903d078e53a59ed65708193f2486ad0b9a8109d8 /include/linux/bitops.h
parente7251484f3bc3bd9203a2c39555ca7d53e988cf6 (diff)
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
downloadlinux-e9331ee9b164d58b4dd0abc882ba7e23d2f404b3.tar.xz
Merge tag 'v4.14-rc1' into asoc-rockchip
Linux 4.14-rc1
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r--include/linux/bitops.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index a83c822c35c2..8fbe259b197c 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -19,10 +19,11 @@
* GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
*/
#define GENMASK(h, l) \
- (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
+ (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
#define GENMASK_ULL(h, l) \
- (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
+ (((~0ULL) - (1ULL << (l)) + 1) & \
+ (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
extern unsigned int __sw_hweight8(unsigned int w);
extern unsigned int __sw_hweight16(unsigned int w);