projects
/
profile
/
ivi
/
kernel-x86-ivi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16a2062
)
mn10300: define __fls
author
Rusty Russell
<rusty@rustcorp.com.au>
Sat, 3 Jan 2009 05:49:03 +0000
(16:19 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Sat, 3 Jan 2009 05:49:03 +0000
(16:19 +1030)
Like fls, but can't be handed 0 and returns the bit number.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/asm-mn10300/bitops.h
patch
|
blob
|
history
diff --git
a/include/asm-mn10300/bitops.h
b/include/asm-mn10300/bitops.h
index
cc6d40c
..
0b610f4
100644
(file)
--- 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
*