1
0
Fork 0

arm: add __ilog2 function

Add __ilog2 function for ARM. Needed for ahci.c

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Albert ARIBAUD <albert.aribaud@free.fr>
utp
Rob Herring 2011-07-05 04:38:51 +00:00 committed by Albert ARIBAUD
parent a60d1e5b8e
commit 0b9bc73711
1 changed files with 5 additions and 0 deletions

View File

@ -106,6 +106,11 @@ static inline int test_bit(int nr, const void * addr)
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,
* so code should check against ~0UL first..