From 37f7d708b082225dd19e7cfa0c86753591d49299 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 30 Mar 2003 22:29:20 -0800 Subject: Did you know that C integer constant promotions are different depending on whether the constant is a hexadecimal one as opposed to a decimal one? Let's make it all explicit. There are probably more lurking around, these were found during development of my C checker tool. --- include/linux/bitops.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/linux') diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 39f3b34a75d5..da24226d5045 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -47,23 +47,23 @@ extern __inline__ int generic_fls(int x) if (!x) return 0; - if (!(x & 0xffff0000)) { + if (!(x & 0xffff0000u)) { x <<= 16; r -= 16; } - if (!(x & 0xff000000)) { + if (!(x & 0xff000000u)) { x <<= 8; r -= 8; } - if (!(x & 0xf0000000)) { + if (!(x & 0xf0000000u)) { x <<= 4; r -= 4; } - if (!(x & 0xc0000000)) { + if (!(x & 0xc0000000u)) { x <<= 2; r -= 2; } - if (!(x & 0x80000000)) { + if (!(x & 0x80000000u)) { x <<= 1; r -= 1; } -- cgit v1.2.3