[U-Boot-Users] [PATCH] ppc: Added fls, fls64, __ilog2_u64, and ffs64 to bitops

Kumar Gala galak at kernel.crashing.org
Wed Jun 11 15:56:29 CEST 2008


On Jun 11, 2008, at 5:54 AM, Haavard Skinnemoen wrote:

> Kumar Gala <galak at kernel.crashing.org> wrote:
>> +/*
>> + * fls: find last (most-significant) bit set.
>> + * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
>> + */
>> +static __inline__ int fls(unsigned int x)
>> +{
>> +	return __ilog2(x) + 1;
>> +}
>
> __ilog2(0) returns -1?

it does.

- k




More information about the U-Boot mailing list