Commit 5c134dad authored by Rusty Russell's avatar Rusty Russell

mn10300: define __fls

Like fls, but can't be handed 0 and returns the bit number.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 16a20626
...@@ -195,6 +195,17 @@ int fls(int x) ...@@ -195,6 +195,17 @@ int fls(int x)
return (x != 0) ? __ilog2_u32(x) + 1 : 0; return (x != 0) ? __ilog2_u32(x) + 1 : 0;
} }
/**
* __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 * ffs - find first bit set
* @x: the word to search * @x: the word to search
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment