public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Russell King <rmk+lkml@arm.linux.org.uk>,
	Haavard Skinnemoen <hskinnemoen@atmel.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	"Linux/m68k" <linux-m68k@vger.kernel.org>
Subject: Re: Yet more ARM breakage in linux-next
Date: Mon, 8 Dec 2008 16:50:34 +1030	[thread overview]
Message-ID: <200812081650.35014.rusty@rustcorp.com.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0812072248430.14941@anakin>

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.

      reply	other threads:[~2008-12-08  6:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 19:29 Yet more ARM breakage in linux-next Russell King
2008-12-03 20:41 ` Andrew Morton
2008-12-03 23:22   ` Rusty Russell
2008-12-03 23:37     ` Randy Dunlap
2008-12-03 23:46       ` Andrew Morton
2008-12-04  0:10         ` Alan Cox
2008-12-04  0:01       ` David Miller
2008-12-04  0:18         ` Randy Dunlap
2008-12-04  1:27       ` Rusty Russell
2008-12-04  2:56         ` Stephen Hemminger
2008-12-04  0:31     ` Russell King
2008-12-04  3:06       ` Nicolas Pitre
2008-12-04  1:33     ` Mike Frysinger
2008-12-04  2:15       ` Rusty Russell
2008-12-04  3:55         ` Mike Frysinger
2008-12-04  9:18   ` Geert Uytterhoeven
2008-12-04 14:12     ` Rusty Russell
2008-12-07 21:50       ` Geert Uytterhoeven
2008-12-08  6:20         ` Rusty Russell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200812081650.35014.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox