|
@@ -77,6 +77,11 @@ static inline int ffs(int x)
|
|
|
return __builtin_ffs(x);
|
|
|
}
|
|
|
|
|
|
+static inline int fls64(__u64 w)
|
|
|
+{
|
|
|
+ return (sizeof(__u64) * 8) - __builtin_clzll(w);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* fls - find last set bit in word
|
|
|
* @x: the word to search
|
|
@@ -90,12 +95,7 @@ static inline int ffs(int x)
|
|
|
*/
|
|
|
static inline int fls(int x)
|
|
|
{
|
|
|
- return (sizeof(int) * 8) - __builtin_clz(x);
|
|
|
-}
|
|
|
-
|
|
|
-static inline int fls64(__u64 w)
|
|
|
-{
|
|
|
- return (sizeof(__u64) * 8) - __builtin_clzll(w);
|
|
|
+ return fls64((unsigned int) x);
|
|
|
}
|
|
|
|
|
|
static inline unsigned int __arch_hweight32(unsigned int w)
|