On Monday 08 December 2008 08:20:59 Geert Uytterhoeven wrote:
> On Fri, 5 Dec 2008, Rusty Russell wrote: 
> > +static inline int __fls(int x)
>                  ^^^       ^^^
> Other implementations take `unsigned long' and return `unsigned long'...

It's all over the place, actually.  32 bit archs are especially loose.

I've been toying with the idea of a boottime testsuite for all the
bitops to see who gets them wrong.

> > +static inline int __fls(unsigned long word)
>                  ^^^       ^^^^^^^^^^^^^
> > +{
> > +   return fls(word) - 1;
> > +}
> > +
> 
> ... but this one uses mixed types?

I cut and pasted.  I thought you were 32 bit, so doesn't matter?

> What are the official semantics of __fls()?

Find last bit set in the word, undefined if word is 0.  Returns 0
to BITS_PER_LONG-1.

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to