On Jun 10, 2008, at 4:58 PM, Wolfgang Denk wrote:

> In message <[EMAIL PROTECTED]>  
> you wrote:
>> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
>
> Comments and code do not match; you'r actually adding much more code.

I was just needing the u64 versions and the other stuff came along to  
make it work :)

>> +/*
>> + * fls: find last (most-significant) bit set.
>> + * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
>> + */
>> +static __inline__ int fls(unsigned int x)
>
> This is not a u64 version of fls64, or is it? ;-)
>
>> +static __inline__ unsigned long __fls(unsigned long x)
>
> Neither is this...
>
> Also: is fls() vs. __fls() a good way to differentiate between int and
> ulong?

I took this from the kernel source tree and didn't really pay much  
attention to it.

>> + * fls64(value) returns 0 if value is 0 or the position of the last
>> + * set bit if value is nonzero. The last (most significant) bit is
>
> Sorry, I can't parse this.

again taken from kernel land.

>> +#elif BITS_PER_LONG == 64
>> +static inline int fls64(__u64 x)
>> +{
>> +    if (x == 0)
>> +            return 0;
>> +    return __fls(x) + 1;
>
> Do I  have to understand where the "+1" is coming from?

Nope, you can just accept it.  I can drop this for now since I don't  
believe we support any ppc64 machines.

>> +static inline int ffs64(u64 x)
>> +{
>> +    return __ilog2_u64(x & -x) + 1ull;
>
> Isn't there an easier way to do this?

Not aware of one.

So, I've stolen this from the kernel and am not sure what you'd like  
for me to change at this point.

- k

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to