Pārlūkot izejas kodu

m68k: define __fls

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>
Rusty Russell 16 gadi atpakaļ
vecāks
revīzija
434ae514c2
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      include/asm-m68k/bitops.h

+ 5 - 0
include/asm-m68k/bitops.h

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