3fc2579e6f
When testing in userspace, UBSAN pointed out that shifting into the sign bit is undefined behaviour. It doesn't really make sense to ask for the highest set bit of a negative value, so just turn the argument type into an unsigned int. Some architectures (eg ppc) already had it declared as an unsigned int, so I don't expect too many problems. Link: http://lkml.kernel.org/r/20181105221117.31828-1-willy@infradead.org Signed-off-by: Matthew Wilcox <willy@infradead.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
__ffs.h | ||
__fls.h | ||
arch_hweight.h | ||
atomic.h | ||
builtin-__ffs.h | ||
builtin-__fls.h | ||
builtin-ffs.h | ||
builtin-fls.h | ||
const_hweight.h | ||
ext2-atomic-setbit.h | ||
ext2-atomic.h | ||
ffs.h | ||
ffz.h | ||
find.h | ||
fls.h | ||
fls64.h | ||
hweight.h | ||
le.h | ||
lock.h | ||
non-atomic.h | ||
sched.h |