From: Rusty Russell Date: Sat, 3 Jan 2009 05:49:03 +0000 (+1030) Subject: mn10300: define __fls X-Git-Tag: v2.6.29-rc1~521^2~10^2~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=5c134dad43443aa9c9606eaf47c378a6b9c5c597;p=~emulex%2Finfiniband.git mn10300: define __fls Like fls, but can't be handed 0 and returns the bit number. Signed-off-by: Rusty Russell --- diff --git a/include/asm-mn10300/bitops.h b/include/asm-mn10300/bitops.h index cc6d40c05cf..0b610f482ab 100644 --- a/include/asm-mn10300/bitops.h +++ b/include/asm-mn10300/bitops.h @@ -195,6 +195,17 @@ int fls(int x) 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 * @x: the word to search