From 8abebe3eadb35222a1147078da4010b4cbfe5858 Mon Sep 17 00:00:00 2001 From: Graeme Russ Date: Tue, 27 Nov 2012 15:38:38 +0000 Subject: [PATCH] x86: Add ilog2 to bitops ilog2 is required by AHCI driver Signed-off-by: Graeme Russ Signed-off-by: Simon Glass --- arch/x86/include/asm/bitops.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index c7a38f237a..5a7e4cba2b 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h @@ -351,6 +351,11 @@ static __inline__ int ffs(int x) } #define PLATFORM_FFS +static inline int __ilog2(unsigned int x) +{ + return generic_fls(x) - 1; +} + /** * hweightN - returns the hamming weight of a N-bit word * @x: the word to weigh -- 2.39.5