aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-01-03 16:19:03 +1030
committerRusty Russell <rusty@rustcorp.com.au>2009-01-03 16:19:03 +1030
commit5c134dad43443aa9c9606eaf47c378a6b9c5c597 (patch)
tree8f724fd07b26b443527f9886bd37b795901c5c7f
parent16a206260ee70f181de6a3672678545859589ef2 (diff)
downloadkernel_samsung_crespo-5c134dad43443aa9c9606eaf47c378a6b9c5c597.zip
kernel_samsung_crespo-5c134dad43443aa9c9606eaf47c378a6b9c5c597.tar.gz
kernel_samsung_crespo-5c134dad43443aa9c9606eaf47c378a6b9c5c597.tar.bz2
mn10300: define __fls
Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--include/asm-mn10300/bitops.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-mn10300/bitops.h b/include/asm-mn10300/bitops.h
index cc6d40c..0b610f4 100644
--- a/include/asm-mn10300/bitops.h
+++ b/include/asm-mn10300/bitops.h
@@ -196,6 +196,17 @@ int fls(int x)
}
/**
+ * __fls - find last (most-significant) set bit in a long word
+ * @word: the word to search
+ *
+ * Undefined if no set bit exists, so code should check against 0 first.
+ */
+static inline unsigned long __fls(unsigned long word)
+{
+ return __ilog2_u32(word);
+}
+
+/**
* ffs - find first bit set
* @x: the word to search
*