[PATCH 1/1] avr32: define __fls

From: Rusty Russell
Date: Wed Dec 03 2008 - 18:49:37 EST


Like fls, but can't be handed 0 and returns the bit number.

(I added find_last_bit() to bitmap.h which broke archs which didn't
define this)

Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
---
arch/avr32/include/asm/bitops.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -263,6 +263,11 @@ static inline int fls(unsigned long word
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 size);
unsigned long find_next_zero_bit(const unsigned long *addr,


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/