summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/sbi_bitops.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/sbi/sbi_bitops.h b/include/sbi/sbi_bitops.h
index d920086..879430d 100644
--- a/include/sbi/sbi_bitops.h
+++ b/include/sbi/sbi_bitops.h
@@ -66,10 +66,8 @@ static inline int ffs(int x)
x >>= 2;
r += 2;
}
- if (!(x & 1)) {
- x >>= 1;
+ if (!(x & 1))
r += 1;
- }
return r;
}
@@ -148,10 +146,8 @@ static inline int fls(int x)
x <<= 2;
r -= 2;
}
- if (!(x & 0x80000000u)) {
- x <<= 1;
+ if (!(x & 0x80000000u))
r -= 1;
- }
return r;
}