Skip to content
Snippets Groups Projects
Commit 0b9bc737 authored by Rob Herring's avatar Rob Herring Committed by Albert ARIBAUD
Browse files

arm: add __ilog2 function


Add __ilog2 function for ARM. Needed for ahci.c

Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Cc: Albert ARIBAUD <albert.aribaud@free.fr>
parent a60d1e5b
No related branches found
No related tags found
No related merge requests found
...@@ -106,6 +106,11 @@ static inline int test_bit(int nr, const void * addr) ...@@ -106,6 +106,11 @@ static inline int test_bit(int nr, const void * addr)
return ((unsigned char *) addr)[nr >> 3] & (1U << (nr & 7)); return ((unsigned char *) addr)[nr >> 3] & (1U << (nr & 7));
} }
static inline int __ilog2(unsigned int x)
{
return generic_fls(x) - 1;
}
/* /*
* ffz = Find First Zero in word. Undefined if no zero exists, * ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first.. * so code should check against ~0UL first..
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment