public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Correct ffs/fls regression for PowerPC etc
@ 2009-09-17 12:39 Simon Kagstrom
  2009-09-17 12:56 ` Stefan Roese
  2009-09-17 13:15 ` [U-Boot] [PATCH v2] " Simon Kagstrom
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Kagstrom @ 2009-09-17 12:39 UTC (permalink / raw)
  To: u-boot

Correct ffs/fls regression for PowerPC etc

Commits

  02f99901ed1c9d828e3ea117f94ce2264bf8389e
  52d61227b66d4099b39c8309ab37cb67ee09a405

introduced a regression where platform-specific ffs/fls implementations
were defined away. This patch corrects that by using PLATFORM_xxx
instead of the name itself.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
I've runtime tested on ARM (OpenRD base) and build-tested on MPC8536DS,
where __ilog2_u64 now at least is non-empty. It would be nice if (at
least!) some PowerPC people could test the patch.

 include/asm-arm/bitops.h        |    8 --------
 include/asm-blackfin/bitops.h   |   10 +---------
 include/asm-i386/bitops.h       |    2 +-
 include/asm-m68k/bitops.h       |    2 +-
 include/asm-microblaze/bitops.h |    3 ++-
 include/asm-mips/bitops.h       |   13 +------------
 include/asm-nios/bitops.h       |    2 +-
 include/asm-nios2/bitops.h      |    2 +-
 include/asm-ppc/bitops.h        |    4 ++--
 include/asm-sh/bitops.h         |    2 +-
 include/linux/bitops.h          |    8 ++++----
 11 files changed, 15 insertions(+), 41 deletions(-)

diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index 3c7b00c..270f163 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -125,14 +125,6 @@ static inline unsigned long ffz(unsigned long word)
 }
 
 /*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
-/*
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
diff --git a/include/asm-blackfin/bitops.h b/include/asm-blackfin/bitops.h
index cc3685d..f469f1c 100644
--- a/include/asm-blackfin/bitops.h
+++ b/include/asm-blackfin/bitops.h
@@ -79,7 +79,7 @@ static __inline__ void __set_bit(int nr, volatile void *addr)
 	mask = 1 << (nr & 0x1f);
 	*a |= mask;
 }
-#define __set_bit
+#define PLATFORM__set_bit
 
 /*
  * clear_bit() doesn't provide any barrier for the compiler.
@@ -270,14 +270,6 @@ static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
 }
 
 /*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x)		generic_ffs(x)
-
-/*
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index ac6285a..c7a38f2 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -349,7 +349,7 @@ static __inline__ int ffs(int x)
 		"1:" : "=r" (r) : "g" (x));
 	return r+1;
 }
-#define ffs
+#define PLATFORM_FFS
 
 /**
  * hweightN - returns the hamming weight of a N-bit word
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index e0c35fa..ad971b4 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -51,7 +51,7 @@ extern __inline__ int ffs(int x)
 	return r;
 }
 #define __ffs(x) (ffs(x) - 1)
-#define ffs
+#define PLATFORM_FFS
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-microblaze/bitops.h b/include/asm-microblaze/bitops.h
index aac9061..3b39e16 100644
--- a/include/asm-microblaze/bitops.h
+++ b/include/asm-microblaze/bitops.h
@@ -23,6 +23,7 @@ extern void __set_bit(int nr, volatile void * addr);
 
 extern void clear_bit(int nr, volatile void * addr);
 #define __clear_bit(nr, addr) clear_bit(nr, addr)
+#define PLATFORM__clear_bit
 
 extern void change_bit(int nr, volatile void * addr);
 extern void __change_bit(int nr, volatile void * addr);
@@ -75,7 +76,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
 	mask = 1 << (nr & 0x1f);
 	*a |= mask;
 }
-#define __set_bit
+#define PLATFORM__set_bit
 
 /*
  * clear_bit() doesn't provide any barrier for the compiler.
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 0c07b68..18dee51 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -90,7 +90,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr)
 
 	*m |= 1UL << (nr & 31);
 }
-#define __set_bit
+#define PLATFORM__set_bit
 
 /*
  * clear_bit - Clears a bit in memory
@@ -706,17 +706,6 @@ static __inline__ unsigned long ffz(unsigned long word)
 
 #ifdef __KERNEL__
 
-/**
- * ffs - find first bit set
- * @x: the word to search
- *
- * This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
 /*
  * hweightN - returns the hamming weight of a N-bit word
  * @x: the word to weigh
diff --git a/include/asm-nios/bitops.h b/include/asm-nios/bitops.h
index 8315fb7..2047b7c 100644
--- a/include/asm-nios/bitops.h
+++ b/include/asm-nios/bitops.h
@@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
 extern int test_and_change_bit(int nr, volatile void * addr);
 extern int test_bit(int nr, volatile void * a);
 extern int ffs(int i);
-#define ffs
+#define PLATFORM_ffs
 
 #endif /* _ASM_NIOS_BITOPS_H */
diff --git a/include/asm-nios2/bitops.h b/include/asm-nios2/bitops.h
index b01a89d..c4851ef 100644
--- a/include/asm-nios2/bitops.h
+++ b/include/asm-nios2/bitops.h
@@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
 extern int test_and_change_bit(int nr, volatile void * addr);
 extern int test_bit(int nr, volatile void * a);
 extern int ffs(int i);
-#define ffs
+#define PLATFORM_ffs
 
 #endif /* __ASM_NIOS2_BITOPS_H */
diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h
index 9ed2f5d..1ad1256 100644
--- a/include/asm-ppc/bitops.h
+++ b/include/asm-ppc/bitops.h
@@ -178,7 +178,7 @@ static __inline__ int fls(unsigned int x)
 {
 	return __ilog2(x) + 1;
 }
-#define fls
+#define PLATFORM_fls
 
 /**
  * fls64 - find last set bit in a 64-bit word
@@ -231,7 +231,7 @@ extern __inline__ int ffs(int x)
 {
 	return __ilog2(x & -x) + 1;
 }
-#define ffs
+#define PLATFORM_ffs
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h
index 95167bd..405c9ff 100644
--- a/include/asm-sh/bitops.h
+++ b/include/asm-sh/bitops.h
@@ -146,7 +146,7 @@ static inline int ffs (int x)
 	}
 	return r;
 }
-#define ffs
+#define PLATFORM_ffs
 
 #endif /* __KERNEL__ */
 
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index e14e6c7..2ea19ce 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -111,19 +111,19 @@ static inline unsigned int generic_hweight8(unsigned int w)
 
 /* linux/include/asm-generic/bitops/non-atomic.h */
 
-#ifndef __set_bit
+#ifndef PLATFORM__set_bit
 # define __set_bit generic_set_bit
 #endif
 
-#ifndef __clear_bit
+#ifndef PLATFORM__clear_bit
 # define __clear_bit generic_clear_bit
 #endif
 
-#ifndef ffs
+#ifndef PLATFORM_ffs
 # define ffs generic_ffs
 #endif
 
-#ifndef fls
+#ifndef PLATFORM_fls
 # define fls generic_fls
 #endif
 
-- 
1.6.0.4

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

* [U-Boot] [PATCH] Correct ffs/fls regression for PowerPC etc
  2009-09-17 12:39 [U-Boot] [PATCH] Correct ffs/fls regression for PowerPC etc Simon Kagstrom
@ 2009-09-17 12:56 ` Stefan Roese
  2009-09-17 13:05   ` Wolfgang Denk
  2009-09-17 13:15 ` [U-Boot] [PATCH v2] " Simon Kagstrom
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Roese @ 2009-09-17 12:56 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On Thursday 17 September 2009 14:39:40 Simon Kagstrom wrote:
> Correct ffs/fls regression for PowerPC etc
> 
> Commits
> 
>   02f99901ed1c9d828e3ea117f94ce2264bf8389e
>   52d61227b66d4099b39c8309ab37cb67ee09a405
> 
> introduced a regression where platform-specific ffs/fls implementations
> were defined away. This patch corrects that by using PLATFORM_xxx
> instead of the name itself.

Thanks. I tested it on my faulting ppc4xx platform (sequoia). And the problem 
is gone now, so thanks.

But I've spotted a problem with other platforms in this patch. See below...
 
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
> ---
> I've runtime tested on ARM (OpenRD base) and build-tested on MPC8536DS,
> where __ilog2_u64 now at least is non-empty. It would be nice if (at
> least!) some PowerPC people could test the patch.
> 
>  include/asm-arm/bitops.h        |    8 --------
>  include/asm-blackfin/bitops.h   |   10 +---------
>  include/asm-i386/bitops.h       |    2 +-
>  include/asm-m68k/bitops.h       |    2 +-
>  include/asm-microblaze/bitops.h |    3 ++-
>  include/asm-mips/bitops.h       |   13 +------------
>  include/asm-nios/bitops.h       |    2 +-
>  include/asm-nios2/bitops.h      |    2 +-
>  include/asm-ppc/bitops.h        |    4 ++--
>  include/asm-sh/bitops.h         |    2 +-
>  include/linux/bitops.h          |    8 ++++----
>  11 files changed, 15 insertions(+), 41 deletions(-)
> 
> diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
> index 3c7b00c..270f163 100644
> --- a/include/asm-arm/bitops.h
> +++ b/include/asm-arm/bitops.h
> @@ -125,14 +125,6 @@ static inline unsigned long ffz(unsigned long word)
>  }
> 
>  /*
> - * ffs: find first bit set. This is defined the same way as
> - * the libc and compiler builtin ffs routines, therefore
> - * differs in spirit from the above ffz (man ffs).
> - */
> -
> -#define ffs(x) generic_ffs(x)
> -
> -/*
>   * hweightN: returns the hamming weight (i.e. the number
>   * of bits set) of a N-bit word
>   */
> diff --git a/include/asm-blackfin/bitops.h b/include/asm-blackfin/bitops.h
> index cc3685d..f469f1c 100644
> --- a/include/asm-blackfin/bitops.h
> +++ b/include/asm-blackfin/bitops.h
> @@ -79,7 +79,7 @@ static __inline__ void __set_bit(int nr, volatile void
>  *addr) mask = 1 << (nr & 0x1f);
>  	*a |= mask;
>  }
> -#define __set_bit
> +#define PLATFORM__set_bit
> 
>  /*
>   * clear_bit() doesn't provide any barrier for the compiler.
> @@ -270,14 +270,6 @@ static __inline__ int find_next_zero_bit(void *addr,
>  int size, int offset) }
> 
>  /*
> - * ffs: find first bit set. This is defined the same way as
> - * the libc and compiler builtin ffs routines, therefore
> - * differs in spirit from the above ffz (man ffs).
> - */
> -
> -#define ffs(x)		generic_ffs(x)
> -
> -/*
>   * hweightN: returns the hamming weight (i.e. the number
>   * of bits set) of a N-bit word
>   */
> diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
> index ac6285a..c7a38f2 100644
> --- a/include/asm-i386/bitops.h
> +++ b/include/asm-i386/bitops.h
> @@ -349,7 +349,7 @@ static __inline__ int ffs(int x)
>  		"1:" : "=r" (r) : "g" (x));
>  	return r+1;
>  }
> -#define ffs
> +#define PLATFORM_FFS

Here you define "FFS" in upper case.

>  /**
>   * hweightN - returns the hamming weight of a N-bit word
> diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
> index e0c35fa..ad971b4 100644
> --- a/include/asm-m68k/bitops.h
> +++ b/include/asm-m68k/bitops.h
> @@ -51,7 +51,7 @@ extern __inline__ int ffs(int x)
>  	return r;
>  }
>  #define __ffs(x) (ffs(x) - 1)
> -#define ffs
> +#define PLATFORM_FFS

And here again.

>  #endif /* __KERNEL__ */
> 
> diff --git a/include/asm-microblaze/bitops.h
>  b/include/asm-microblaze/bitops.h index aac9061..3b39e16 100644
> --- a/include/asm-microblaze/bitops.h
> +++ b/include/asm-microblaze/bitops.h
> @@ -23,6 +23,7 @@ extern void __set_bit(int nr, volatile void * addr);
> 
>  extern void clear_bit(int nr, volatile void * addr);
>  #define __clear_bit(nr, addr) clear_bit(nr, addr)
> +#define PLATFORM__clear_bit
> 
>  extern void change_bit(int nr, volatile void * addr);
>  extern void __change_bit(int nr, volatile void * addr);
> @@ -75,7 +76,7 @@ extern __inline__ void __set_bit(int nr, volatile void *
>  addr) mask = 1 << (nr & 0x1f);
>  	*a |= mask;
>  }
> -#define __set_bit
> +#define PLATFORM__set_bit
> 
>  /*
>   * clear_bit() doesn't provide any barrier for the compiler.
> diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
> index 0c07b68..18dee51 100644
> --- a/include/asm-mips/bitops.h
> +++ b/include/asm-mips/bitops.h
> @@ -90,7 +90,7 @@ static __inline__ void __set_bit(int nr, volatile void *
>  addr)
> 
>  	*m |= 1UL << (nr & 31);
>  }
> -#define __set_bit
> +#define PLATFORM__set_bit
> 
>  /*
>   * clear_bit - Clears a bit in memory
> @@ -706,17 +706,6 @@ static __inline__ unsigned long ffz(unsigned long
>  word)
> 
>  #ifdef __KERNEL__
> 
> -/**
> - * ffs - find first bit set
> - * @x: the word to search
> - *
> - * This is defined the same way as
> - * the libc and compiler builtin ffs routines, therefore
> - * differs in spirit from the above ffz (man ffs).
> - */
> -
> -#define ffs(x) generic_ffs(x)
> -
>  /*
>   * hweightN - returns the hamming weight of a N-bit word
>   * @x: the word to weigh
> diff --git a/include/asm-nios/bitops.h b/include/asm-nios/bitops.h
> index 8315fb7..2047b7c 100644
> --- a/include/asm-nios/bitops.h
> +++ b/include/asm-nios/bitops.h
> @@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
>  extern int test_and_change_bit(int nr, volatile void * addr);
>  extern int test_bit(int nr, volatile void * a);
>  extern int ffs(int i);
> -#define ffs
> +#define PLATFORM_ffs

Here it's lower case.

<snip>

> +++ b/include/linux/bitops.h
> @@ -111,19 +111,19 @@ static inline unsigned int generic_hweight8(unsigned
>  int w)
> 
>  /* linux/include/asm-generic/bitops/non-atomic.h */
> 
> -#ifndef __set_bit
> +#ifndef PLATFORM__set_bit
>  # define __set_bit generic_set_bit
>  #endif
> 
> -#ifndef __clear_bit
> +#ifndef PLATFORM__clear_bit
>  # define __clear_bit generic_clear_bit
>  #endif
> 
> -#ifndef ffs
> +#ifndef PLATFORM_ffs
>  # define ffs generic_ffs
>  #endif

And here you check against lower case "_ffs". So the platforms with upper case 
"_FFS" are still broken. Please fix and resubmit.

Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH] Correct ffs/fls regression for PowerPC etc
  2009-09-17 12:56 ` Stefan Roese
@ 2009-09-17 13:05   ` Wolfgang Denk
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2009-09-17 13:05 UTC (permalink / raw)
  To: u-boot

Dear Stefan Roese,

In message <200909171456.33234.sr@denx.de> you wrote:
> 
> Thanks. I tested it on my faulting ppc4xx platform (sequoia). And the problem 
> is gone now, so thanks.

Thanks for testing.

> But I've spotted a problem with other platforms in this patch. See below...
...
> > -#define ffs
> > +#define PLATFORM_FFS
> 
> Here you define "FFS" in upper case.

... which is acctually correct, as macro names _shall_ use upper case
letters.

...
> > -#define __set_bit
> > +#define PLATFORM__set_bit

This is not a legal macro name.

> > -#define ffs
> > +#define PLATFORM_ffs
> 
> Here it's lower case.

Yeah, the patch is not clean.

> > -#ifndef ffs
> > +#ifndef PLATFORM_ffs
> >  # define ffs generic_ffs
> >  #endif
> 
> And here you check against lower case "_ffs". So the platforms with upper case 
> "_FFS" are still broken. Please fix and resubmit.


Simon, this needs to be cleaned up. Please make sure to use upper case
macro names only.

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
You humans have that emotional need  to  express  gratitude.  "You're
welcome," I believe, is the correct response.
	-- Spock, "Bread and Circuses", stardate 4041.2

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

* [U-Boot] [PATCH v2] Correct ffs/fls regression for PowerPC etc
  2009-09-17 12:39 [U-Boot] [PATCH] Correct ffs/fls regression for PowerPC etc Simon Kagstrom
  2009-09-17 12:56 ` Stefan Roese
@ 2009-09-17 13:15 ` Simon Kagstrom
  2009-09-17 14:03   ` Kumar Gala
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Simon Kagstrom @ 2009-09-17 13:15 UTC (permalink / raw)
  To: u-boot

Correct ffs/fls regression for PowerPC etc

Commits

  02f99901ed1c9d828e3ea117f94ce2264bf8389e
  52d61227b66d4099b39c8309ab37cb67ee09a405

introduced a regression where platform-specific ffs/fls implementations
were defined away. This patch corrects that by using PLATFORM_xxx
instead of the name itself.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
I've runtime tested on ARM (OpenRD base) and build-tested on MPC8536DS,
where __ilog2_u64 now at least is non-empty. It would be nice if (at
least!) some PowerPC people could test the patch.


ChangeLog:

v2 - Make _all_ macros upper case (Stefan, Wolfgang)


 include/asm-arm/bitops.h        |    8 --------
 include/asm-blackfin/bitops.h   |   10 +---------
 include/asm-i386/bitops.h       |    2 +-
 include/asm-m68k/bitops.h       |    2 +-
 include/asm-microblaze/bitops.h |    3 ++-
 include/asm-mips/bitops.h       |   13 +------------
 include/asm-nios/bitops.h       |    2 +-
 include/asm-nios2/bitops.h      |    2 +-
 include/asm-ppc/bitops.h        |    4 ++--
 include/asm-sh/bitops.h         |    2 +-
 include/linux/bitops.h          |    8 ++++----
 11 files changed, 15 insertions(+), 41 deletions(-)

diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index 3c7b00c..270f163 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -125,14 +125,6 @@ static inline unsigned long ffz(unsigned long word)
 }
 
 /*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
-/*
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
diff --git a/include/asm-blackfin/bitops.h b/include/asm-blackfin/bitops.h
index cc3685d..ab1fea5 100644
--- a/include/asm-blackfin/bitops.h
+++ b/include/asm-blackfin/bitops.h
@@ -79,7 +79,7 @@ static __inline__ void __set_bit(int nr, volatile void *addr)
 	mask = 1 << (nr & 0x1f);
 	*a |= mask;
 }
-#define __set_bit
+#define PLATFORM__SET_BIT
 
 /*
  * clear_bit() doesn't provide any barrier for the compiler.
@@ -270,14 +270,6 @@ static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
 }
 
 /*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x)		generic_ffs(x)
-
-/*
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index ac6285a..c7a38f2 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -349,7 +349,7 @@ static __inline__ int ffs(int x)
 		"1:" : "=r" (r) : "g" (x));
 	return r+1;
 }
-#define ffs
+#define PLATFORM_FFS
 
 /**
  * hweightN - returns the hamming weight of a N-bit word
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index e0c35fa..ad971b4 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -51,7 +51,7 @@ extern __inline__ int ffs(int x)
 	return r;
 }
 #define __ffs(x) (ffs(x) - 1)
-#define ffs
+#define PLATFORM_FFS
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-microblaze/bitops.h b/include/asm-microblaze/bitops.h
index aac9061..5d814f0 100644
--- a/include/asm-microblaze/bitops.h
+++ b/include/asm-microblaze/bitops.h
@@ -23,6 +23,7 @@ extern void __set_bit(int nr, volatile void * addr);
 
 extern void clear_bit(int nr, volatile void * addr);
 #define __clear_bit(nr, addr) clear_bit(nr, addr)
+#define PLATFORM__CLEAR_BIT
 
 extern void change_bit(int nr, volatile void * addr);
 extern void __change_bit(int nr, volatile void * addr);
@@ -75,7 +76,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
 	mask = 1 << (nr & 0x1f);
 	*a |= mask;
 }
-#define __set_bit
+#define PLATFORM__SET_BIT
 
 /*
  * clear_bit() doesn't provide any barrier for the compiler.
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 0c07b68..1c8f4c0 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -90,7 +90,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr)
 
 	*m |= 1UL << (nr & 31);
 }
-#define __set_bit
+#define PLATFORM__SET_BIT
 
 /*
  * clear_bit - Clears a bit in memory
@@ -706,17 +706,6 @@ static __inline__ unsigned long ffz(unsigned long word)
 
 #ifdef __KERNEL__
 
-/**
- * ffs - find first bit set
- * @x: the word to search
- *
- * This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
 /*
  * hweightN - returns the hamming weight of a N-bit word
  * @x: the word to weigh
diff --git a/include/asm-nios/bitops.h b/include/asm-nios/bitops.h
index 8315fb7..0be74f4 100644
--- a/include/asm-nios/bitops.h
+++ b/include/asm-nios/bitops.h
@@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
 extern int test_and_change_bit(int nr, volatile void * addr);
 extern int test_bit(int nr, volatile void * a);
 extern int ffs(int i);
-#define ffs
+#define PLATFORM_FFS
 
 #endif /* _ASM_NIOS_BITOPS_H */
diff --git a/include/asm-nios2/bitops.h b/include/asm-nios2/bitops.h
index b01a89d..5776bda 100644
--- a/include/asm-nios2/bitops.h
+++ b/include/asm-nios2/bitops.h
@@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
 extern int test_and_change_bit(int nr, volatile void * addr);
 extern int test_bit(int nr, volatile void * a);
 extern int ffs(int i);
-#define ffs
+#define PLATFORM_FFS
 
 #endif /* __ASM_NIOS2_BITOPS_H */
diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h
index 9ed2f5d..adaf091 100644
--- a/include/asm-ppc/bitops.h
+++ b/include/asm-ppc/bitops.h
@@ -178,7 +178,7 @@ static __inline__ int fls(unsigned int x)
 {
 	return __ilog2(x) + 1;
 }
-#define fls
+#define PLATFORM_FLS
 
 /**
  * fls64 - find last set bit in a 64-bit word
@@ -231,7 +231,7 @@ extern __inline__ int ffs(int x)
 {
 	return __ilog2(x & -x) + 1;
 }
-#define ffs
+#define PLATFORM_FFS
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h
index 95167bd..c57d628 100644
--- a/include/asm-sh/bitops.h
+++ b/include/asm-sh/bitops.h
@@ -146,7 +146,7 @@ static inline int ffs (int x)
 	}
 	return r;
 }
-#define ffs
+#define PLATFORM_FFS
 
 #endif /* __KERNEL__ */
 
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index e14e6c7..e724310 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -111,19 +111,19 @@ static inline unsigned int generic_hweight8(unsigned int w)
 
 /* linux/include/asm-generic/bitops/non-atomic.h */
 
-#ifndef __set_bit
+#ifndef PLATFORM__SET_BIT
 # define __set_bit generic_set_bit
 #endif
 
-#ifndef __clear_bit
+#ifndef PLATFORM__CLEAR_BIT
 # define __clear_bit generic_clear_bit
 #endif
 
-#ifndef ffs
+#ifndef PLATFORM_FFS
 # define ffs generic_ffs
 #endif
 
-#ifndef fls
+#ifndef PLATFORM_FLS
 # define fls generic_fls
 #endif
 
-- 
1.6.0.4

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

* [U-Boot] [PATCH v2] Correct ffs/fls regression for PowerPC etc
  2009-09-17 13:15 ` [U-Boot] [PATCH v2] " Simon Kagstrom
@ 2009-09-17 14:03   ` Kumar Gala
  2009-09-17 14:13   ` Stefan Roese
  2009-09-17 20:44   ` Wolfgang Denk
  2 siblings, 0 replies; 9+ messages in thread
From: Kumar Gala @ 2009-09-17 14:03 UTC (permalink / raw)
  To: u-boot


On Sep 17, 2009, at 8:15 AM, Simon Kagstrom wrote:

> Correct ffs/fls regression for PowerPC etc
>
> Commits
>
>  02f99901ed1c9d828e3ea117f94ce2264bf8389e
>  52d61227b66d4099b39c8309ab37cb67ee09a405
>
> introduced a regression where platform-specific ffs/fls  
> implementations
> were defined away. This patch corrects that by using PLATFORM_xxx
> instead of the name itself.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
> ---
> I've runtime tested on ARM (OpenRD base) and build-tested on  
> MPC8536DS,
> where __ilog2_u64 now at least is non-empty. It would be nice if (at
> least!) some PowerPC people could test the patch.
>
>
> ChangeLog:
>
> v2 - Make _all_ macros upper case (Stefan, Wolfgang)
>

Acked-by: Kumar Gala <galak@kernel.crashing.org>

This fixes the issue I was seeing.

- k

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

* [U-Boot] [PATCH v2] Correct ffs/fls regression for PowerPC etc
  2009-09-17 13:15 ` [U-Boot] [PATCH v2] " Simon Kagstrom
  2009-09-17 14:03   ` Kumar Gala
@ 2009-09-17 14:13   ` Stefan Roese
  2009-09-17 14:22     ` Simon Kagstrom
  2009-09-17 20:44   ` Wolfgang Denk
  2 siblings, 1 reply; 9+ messages in thread
From: Stefan Roese @ 2009-09-17 14:13 UTC (permalink / raw)
  To: u-boot

On Thursday 17 September 2009 15:15:52 Simon Kagstrom wrote:
> Correct ffs/fls regression for PowerPC etc
> 
> Commits
> 
>   02f99901ed1c9d828e3ea117f94ce2264bf8389e
>   52d61227b66d4099b39c8309ab37cb67ee09a405
> 
> introduced a regression where platform-specific ffs/fls implementations
> were defined away. This patch corrects that by using PLATFORM_xxx
> instead of the name itself.
> 
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>

You have the subject "Correct ffs/fls regression for PowerPC etc" twice in the 
commit message, once in the email subject and once at the beginning of the 
mail body.

Other than this:

Acked-by: Stefan Roese <sr@denx.de>

Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH v2] Correct ffs/fls regression for PowerPC etc
  2009-09-17 14:13   ` Stefan Roese
@ 2009-09-17 14:22     ` Simon Kagstrom
  2009-09-17 14:25       ` Stefan Roese
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Kagstrom @ 2009-09-17 14:22 UTC (permalink / raw)
  To: u-boot

On Thu, 17 Sep 2009 16:13:26 +0200
Stefan Roese <sr@denx.de> wrote:

> You have the subject "Correct ffs/fls regression for PowerPC etc" twice in the 
> commit message, once in the email subject and once at the beginning of the 
> mail body.

Well, I'll admit that I haven't setup git to send emails yet, so I
simply paste them into my regular mail program. I'll submit with the
first line only in the subject from now on.

Or setup git-send-email one day :-)

// Simon

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

* [U-Boot] [PATCH v2] Correct ffs/fls regression for PowerPC etc
  2009-09-17 14:22     ` Simon Kagstrom
@ 2009-09-17 14:25       ` Stefan Roese
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Roese @ 2009-09-17 14:25 UTC (permalink / raw)
  To: u-boot

On Thursday 17 September 2009 16:22:12 Simon Kagstrom wrote:
> > You have the subject "Correct ffs/fls regression for PowerPC etc" twice
> > in the commit message, once in the email subject and once at the
> > beginning of the mail body.
> 
> Well, I'll admit that I haven't setup git to send emails yet, so I
> simply paste them into my regular mail program. I'll submit with the
> first line only in the subject from now on.
> 
> Or setup git-send-email one day :-)

Yes, git send-email really saves time and trouble from my experience. :)
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH v2] Correct ffs/fls regression for PowerPC etc
  2009-09-17 13:15 ` [U-Boot] [PATCH v2] " Simon Kagstrom
  2009-09-17 14:03   ` Kumar Gala
  2009-09-17 14:13   ` Stefan Roese
@ 2009-09-17 20:44   ` Wolfgang Denk
  2 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2009-09-17 20:44 UTC (permalink / raw)
  To: u-boot

Dear Simon Kagstrom,

In message <20090917151552.013d4e60@marrow.netinsight.se> you wrote:
> Correct ffs/fls regression for PowerPC etc
> 
> Commits
> 
>   02f99901ed1c9d828e3ea117f94ce2264bf8389e
>   52d61227b66d4099b39c8309ab37cb67ee09a405
> 
> introduced a regression where platform-specific ffs/fls implementations
> were defined away. This patch corrects that by using PLATFORM_xxx
> instead of the name itself.
> 
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
> ---
> I've runtime tested on ARM (OpenRD base) and build-tested on MPC8536DS,
> where __ilog2_u64 now at least is non-empty. It would be nice if (at
> least!) some PowerPC people could test the patch.
> 
> 
> ChangeLog:
> 
> v2 - Make _all_ macros upper case (Stefan, Wolfgang)
> 
> 
>  include/asm-arm/bitops.h        |    8 --------
>  include/asm-blackfin/bitops.h   |   10 +---------
>  include/asm-i386/bitops.h       |    2 +-
>  include/asm-m68k/bitops.h       |    2 +-
>  include/asm-microblaze/bitops.h |    3 ++-
>  include/asm-mips/bitops.h       |   13 +------------
>  include/asm-nios/bitops.h       |    2 +-
>  include/asm-nios2/bitops.h      |    2 +-
>  include/asm-ppc/bitops.h        |    4 ++--
>  include/asm-sh/bitops.h         |    2 +-
>  include/linux/bitops.h          |    8 ++++----
>  11 files changed, 15 insertions(+), 41 deletions(-)

Applied, thanks.

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
It may be bad manners to talk with your mouth full, but it isn't  too
good either if you speak when your head is empty.

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

end of thread, other threads:[~2009-09-17 20:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 12:39 [U-Boot] [PATCH] Correct ffs/fls regression for PowerPC etc Simon Kagstrom
2009-09-17 12:56 ` Stefan Roese
2009-09-17 13:05   ` Wolfgang Denk
2009-09-17 13:15 ` [U-Boot] [PATCH v2] " Simon Kagstrom
2009-09-17 14:03   ` Kumar Gala
2009-09-17 14:13   ` Stefan Roese
2009-09-17 14:22     ` Simon Kagstrom
2009-09-17 14:25       ` Stefan Roese
2009-09-17 20:44   ` Wolfgang Denk

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