diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-08 08:27:03 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-02-08 08:27:03 +0100 |
commit | 7482ab4de107d6fe3136f741ad6a3d423661f125 (patch) | |
tree | 06bf853ab81348f0a4028fb3c41978b61dfb03f6 /include/linux | |
parent | c0735348802c29cc46db3758b5e477f2bc8ff058 (diff) | |
parent | 2ee6bb35043de0bc994da4bf3f0139280229c3bd (diff) | |
download | barebox-7482ab4de107d6fe3136f741ad6a3d423661f125.tar.gz barebox-7482ab4de107d6fe3136f741ad6a3d423661f125.tar.xz |
Merge branch 'for-next/regmap'
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bitops.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index f3a740c461..31345c219d 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -18,8 +18,11 @@ * position @h. For example * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. */ -#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) -#define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l)) +#define GENMASK(h, l) \ + (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) + +#define GENMASK_ULL(h, l) \ + (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) extern unsigned int __sw_hweight8(unsigned int w); extern unsigned int __sw_hweight16(unsigned int w); |