Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core fix from Ingo Molnar:
"Fix GENMASK macro shift overflow"

Nobody seems to currently use GENMASK() to fill every single last bit
(which is what overflows) in-tree, and gcc would warn about it, so we
have that going for us. But apparently there are pending changes that
want this.

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
bitops: Fix shift overflow in GENMASK macros

+5 -2
+5 -2
include/linux/bitops.h
··· 18 18 * position @h. For example 19 19 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. 20 20 */ 21 - #define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) 22 - #define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l)) 21 + #define GENMASK(h, l) \ 22 + (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) 23 + 24 + #define GENMASK_ULL(h, l) \ 25 + (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) 23 26 24 27 extern unsigned int __sw_hweight8(unsigned int w); 25 28 extern unsigned int __sw_hweight16(unsigned int w);