public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* Re: Yet more ARM breakage in linux-next
       [not found]     ` <200812050042.28222.rusty@rustcorp.com.au>
@ 2008-12-07 21:50       ` Geert Uytterhoeven
  2008-12-08  6:20         ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2008-12-07 21:50 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Andrew Morton, Russell King, Haavard Skinnemoen, Stephen Rothwell,
	Linux Kernel Development, Linux/m68k

On Fri, 5 Dec 2008, Rusty Russell wrote:
> On Thursday 04 December 2008 19:48:06 Geert Uytterhoeven wrote:
> > Also broke m68k (a bit more hidden due to other build failures).
> 
> And m68knommu has similar issues.
> 
> Here's what I have for m68k for tomorrow's linux-next.  Please steal.
> 
> m68k: define __fls
> 
> Like fls, but can't be handed 0 and returns the bit number.
> 
> (I broke this arch in linux-next by using __fls in generic code).
> 
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> 
> diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
> --- a/include/asm-m68k/bitops.h
> +++ b/include/asm-m68k/bitops.h
> @@ -315,6 +315,11 @@ static inline int fls(int x)
>  	return 32 - cnt;
>  }
>  
> +static inline int __fls(int x)
                 ^^^       ^^^
Other implementations take `unsigned long' and return `unsigned long'...

> +{
> +	return fls(x) - 1;
> +}
> +

On Thu, 4 Dec 2008, Rusty Russell wrote:
> Like fls, but can't be handed 0 and returns the bit number.
> 
> (I added find_last_bit() to bitmap.h which broke archs which didn't
>  define this)
> 
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> ---
>  arch/avr32/include/asm/bitops.h |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
> --- a/arch/avr32/include/asm/bitops.h
> +++ b/arch/avr32/include/asm/bitops.h
> @@ -263,6 +263,11 @@ static inline int fls(unsigned long word
>  	return 32 - result;
>  }
>  
> +static inline int __fls(unsigned long word)
                 ^^^       ^^^^^^^^^^^^^
> +{
> +	return fls(word) - 1;
> +}
> +

... but this one uses mixed types?

What are the official semantics of __fls()?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Yet more ARM breakage in linux-next
  2008-12-07 21:50       ` Yet more ARM breakage in linux-next Geert Uytterhoeven
@ 2008-12-08  6:20         ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2008-12-08  6:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Andrew Morton, Russell King, Haavard Skinnemoen, Stephen Rothwell,
	Linux Kernel Development, Linux/m68k

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-08  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20081203192905.GA12502@flint.arm.linux.org.uk>
     [not found] ` <20081203124109.79f8f15b.akpm@linux-foundation.org>
     [not found]   ` <Pine.LNX.4.64.0812041017470.10635@anakin>
     [not found]     ` <200812050042.28222.rusty@rustcorp.com.au>
2008-12-07 21:50       ` Yet more ARM breakage in linux-next Geert Uytterhoeven
2008-12-08  6:20         ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox