public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] avr32: define __fls
@ 2008-12-03 23:49 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2008-12-03 23:49 UTC (permalink / raw)
  To: Haavard Skinnemoen; +Cc: linux-kernel, Stephen Rothwell

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@rustcorp.com.au>
---
 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,



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-03 23:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 23:49 [PATCH 1/1] avr32: define __fls Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox