[U-Boot] [PATCH 2/8]: Define ffs/fls for all architectures

Wolfgang Denk wd at denx.de
Mon Jul 20 23:37:37 CEST 2009


Dear Simon Kagstrom,

In message <20090707155734.4b757923 at marrow.netinsight.se> you wrote:
> UBIFS requires fls(), which is not defined for arm (and some other
> architectures) and this patch adds it. The implementation is taken from
> Linux and is generic. ffs() is also defined for those that miss it.
> 
> Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> ---
>  include/asm-arm/bitops.h        |    4 ++++
>  include/asm-avr32/bitops.h      |    3 +++
>  include/asm-i386/bitops.h       |    2 ++
>  include/asm-m68k/bitops.h       |    2 ++
>  include/asm-microblaze/bitops.h |    2 ++
>  include/asm-mips/bitops.h       |    2 ++
>  include/asm-nios/bitops.h       |    4 +++-
>  include/asm-nios2/bitops.h      |    4 +++-
>  include/asm-sh/bitops.h         |    2 ++
>  include/asm-sparc/bitops.h      |    3 +++
>  include/linux/bitops.h          |   37 +++++++++++++++++++++++++++++++++++++
>  11 files changed, 63 insertions(+), 2 deletions(-)

This patch does not apply at all:

Applying: Define ffs/fls for all architectures
error: patch failed: include/asm-avr32/bitops.h:25
error: include/asm-avr32/bitops.h: patch does not apply
error: patch failed: include/asm-nios/bitops.h:32
error: include/asm-nios/bitops.h: patch does not apply
error: patch failed: include/asm-nios2/bitops.h:32
error: include/asm-nios2/bitops.h: patch does not apply
error: patch failed: include/asm-sh/bitops.h:147
error: include/asm-sh/bitops.h: patch does not apply
error: patch failed: include/asm-sparc/bitops.h:29
error: include/asm-sparc/bitops.h: patch does not apply
fatal: sha1 information is lacking or useless (include/asm-avr32/bitops.h).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001.


> diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
> index 4b8bab2..e98dd56 100644
> --- a/include/asm-arm/bitops.h
> +++ b/include/asm-arm/bitops.h
> @@ -17,6 +17,8 @@
>  
>  #ifdef __KERNEL__
>  
> +#include <asm/types.h>
> +
>  #define smp_mb__before_clear_bit()	do { } while (0)
>  #define smp_mb__after_clear_bit()	do { } while (0)
>  
> @@ -117,6 +119,8 @@ static inline unsigned long ffz(unsigned long word)
>  
>  #define ffs(x) generic_ffs(x)
>  
> +#define fls(x) generic_fls(x)

Please use a consistent style: here you have an empty line between
the two #define's.

> diff --git a/include/asm-avr32/bitops.h b/include/asm-avr32/bitops.h
> index bb272d8..75ba1c2 100644
> --- a/include/asm-avr32/bitops.h
> +++ b/include/asm-avr32/bitops.h
> @@ -25,4 +25,7 @@
>  #define __set_bit(nr, addr) generic_set_bit(nr, addr)
>  #define __clear_bit(nr, addr) generic_clear_bit(nr, addr)
>  
> +#define ffs(x) generic_ffs(x)
> +#define fls(x) generic_fls(x)

Here you don't ... and do on.


Please clean up and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is a multi-legged creature crawling on your shoulder.
	-- Spock, "A Taste of Armageddon", stardate 3193.9


More information about the U-Boot mailing list