public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: Yet more ARM breakage in linux-next
Date: Thu, 4 Dec 2008 09:52:44 +1030	[thread overview]
Message-ID: <200812040952.44957.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20081203124109.79f8f15b.akpm@linux-foundation.org>

On Thursday 04 December 2008 07:11:09 Andrew Morton wrote:
> On Wed, 3 Dec 2008 19:29:05 +0000
>
> Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> > This seems to be causing lots of ARM breakage:
> >
> > lib/find_next_bit.c:183: error: implicit declaration of function '__fls'
> >
> > Whoever's responsible,
>
> git-blame?

It's me.  Turns out sparc, avr32 and arm all don't define __fls in their
asm/bitops.h, and I'm the first one to use it in generic code.

But as I prepared this patch, I note that the armv5 __fls/fls is wrong:

  /* Implement fls() in C so that 64-bit args are suitably truncated */
  static inline int fls(int x)
  {
      return __fls(x);
  }

__fls(x) returns a bit number (0-31).  fls() returns 0 or bitnumber+1.

(Yes, classic useless kerneldoc documentation doesn't actually *say* 
this clearly).

But here's the linux-next fix:

arm: define __fls for pre v5 ARM

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -239,6 +239,7 @@ extern int _find_next_bit_be(const unsig
 #include <asm-generic/bitops/ffz.h>
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/ffs.h>
 
 #else


  reply	other threads:[~2008-12-03 23:22 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 [this message]
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

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=200812040952.44957.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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