From 769d2f1d5b36f3796c1698f32b7dbe3c1e9e5b01 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Fri, 25 May 2012 12:32:09 -0400 Subject: [PATCH] --- yaml --- r: 308084 b: refs/heads/master c: 9f1d62bed7f015d11b9164078b7fea433b474114 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/tile/include/asm/bitops.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index afa8da21e21c..c91e777b8a90 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: acd1a19e002790dd127b3ff86f95a4d269e7f1d0 +refs/heads/master: 9f1d62bed7f015d11b9164078b7fea433b474114 diff --git a/trunk/arch/tile/include/asm/bitops.h b/trunk/arch/tile/include/asm/bitops.h index 16f1fa51fea1..bd186c4eaa50 100644 --- a/trunk/arch/tile/include/asm/bitops.h +++ b/trunk/arch/tile/include/asm/bitops.h @@ -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)