projects
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c73c6de
)
x86: Add ilog2 to bitops
author
Graeme Russ
<graeme.russ@gmail.com>
Tue, 27 Nov 2012 15:38:38 +0000
(15:38 +0000)
committer
Simon Glass
<sjg@chromium.org>
Wed, 28 Nov 2012 19:40:03 +0000
(11:40 -0800)
ilog2 is required by AHCI driver
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/include/asm/bitops.h
patch
|
blob
|
history
diff --git
a/arch/x86/include/asm/bitops.h
b/arch/x86/include/asm/bitops.h
index c7a38f237a5cf0bcbbcf996ff8ffc01698a62220..5a7e4cba2b2fb48786206331e64222fda5f9f865 100644
(file)
--- 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