lkml.org 
[lkml]   [2008]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Yet more ARM breakage in linux-next
Rusty Russell wrote:
> 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).

oh fud. That's not a fault of kernel-doc, just of whoever wrote it.
It's only as good as someone makes it.


> 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



\
 
 \ /
  Last update: 2008-12-04 00:41    [from the cache]
©2003-2011 Jasper Spaans