|author||Matthew Wilcox <email@example.com>||2019-01-03 15:26:41 -0800|
|committer||Linus Torvalds <firstname.lastname@example.org>||2019-01-04 13:13:46 -0800|
|parent||include/linux/printk.h: drop silly "static inline asmlinkage" from dump_stack() (diff)|
fls: change parameter to unsigned int
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://email@example.com Signed-off-by: Matthew Wilcox <firstname.lastname@example.org> Acked-by: Thomas Gleixner <email@example.com> Acked-by: Geert Uytterhoeven <firstname.lastname@example.org> Cc: <email@example.com> Signed-off-by: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com>
Diffstat (limited to '')
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
index 2691a1857d20..bee974262387 100644
@@ -211,7 +211,7 @@ static inline long ffz(int x)
* This is defined the same way as ffs.
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
-static inline int fls(int x)
+static inline int fls(unsigned int x)