瀏覽代碼

avr32: 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 年之前
父節點
當前提交
96b8d4c19d
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      arch/avr32/include/asm/bitops.h

+ 5 - 0
arch/avr32/include/asm/bitops.h

@@ -263,6 +263,11 @@ static inline int fls(unsigned long word)
 	return 32 - result;
 	return 32 - result;
 }
 }
 
 
+static inline int __fls(unsigned long word)
+{
+	return fls(word) - 1;
+}
+
 unsigned long find_first_zero_bit(const unsigned long *addr,
 unsigned long find_first_zero_bit(const unsigned long *addr,
 				  unsigned long size);
 				  unsigned long size);
 unsigned long find_next_zero_bit(const unsigned long *addr,
 unsigned long find_next_zero_bit(const unsigned long *addr,