summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-03-30 22:29:20 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2003-03-30 22:29:20 -0800
commit37f7d708b082225dd19e7cfa0c86753591d49299 (patch)
tree24c44a398becd39d3f3825ddac2df057e756216d /include/linux
parent9e0206abf1d74a1001f3b4a912767d4072856cda (diff)
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.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bitops.h10
1 files changed, 5 insertions, 5 deletions
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;
}