m68k: define __fls
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Dec 2008 23:42:18 +0000 (10:12 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Dec 2008 23:42:18 +0000 (10:12 +1030)
Like fls, but can't be handed 0 and returns the bit number.

(I broke this arch in linux-next by using __fls in generic code).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/asm-m68k/bitops.h

index 3e8106442d5af6e7953b887ebdb8a35203e5f029..9bde784e7bad038a41d471a22af238587a998aad 100644 (file)
@@ -315,6 +315,11 @@ static inline int fls(int x)
        return 32 - cnt;
 }
 
+static inline int __fls(int x)
+{
+       return fls(x) - 1;
+}
+
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>