]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Correct ffs/fls regression for PowerPC etc
authorSimon Kagstrom <simon.kagstrom@netinsight.net>
Thu, 17 Sep 2009 13:15:52 +0000 (15:15 +0200)
committerWolfgang Denk <wd@denx.de>
Thu, 17 Sep 2009 20:45:31 +0000 (22:45 +0200)
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>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
include/asm-arm/bitops.h
include/asm-blackfin/bitops.h
include/asm-i386/bitops.h
include/asm-m68k/bitops.h
include/asm-microblaze/bitops.h
include/asm-mips/bitops.h
include/asm-nios/bitops.h
include/asm-nios2/bitops.h
include/asm-ppc/bitops.h
include/asm-sh/bitops.h
include/linux/bitops.h

index 3c7b00c48d033452ddd5a2fee1a9c45bc7efa645..270f163eee3fb5ebe190cec4352c19901361eba9 100644 (file)
@@ -124,14 +124,6 @@ static inline unsigned long ffz(unsigned long word)
        return k;
 }
 
-/*
- * 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
index cc3685d35d7bd2d09b6b75b24b44dbe56850e983..ab1fea55c87f0d603f1b957a7ac48952d7c1c590 100644 (file)
@@ -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.
@@ -269,14 +269,6 @@ static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
        return result + ffz(tmp);
 }
 
-/*
- * 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
index ac6285aa5f2eb6cae88a0a17f57c911fc54e04b4..c7a38f237a5cf0bcbbcf996ff8ffc01698a62220 100644 (file)
@@ -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
index e0c35fa7b055162aee02451bc2219528393db349..ad971b4f31ffccbb816c2c63b2113db87e0a8395 100644 (file)
@@ -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__ */
 
index aac906102abc1817c6eddbe2cfd1e6382c33ee7f..5d814f0eb0e9c3f02aac7aed9e02745312c47d2f 100644 (file)
@@ -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.
index 0c07b686a2d54de1b8f9b36981192c14d51951bd..1c8f4c05003ba83ff0aacf66d94268d901dbf21a 100644 (file)
@@ -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
index 8315fb7caafa6986b8c2cf8df7c5b932d13957df..0be74f42b8fc0e4b23f21866e0f3ad0b959ae150 100644 (file)
@@ -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 */
index b01a89d63cd3f4bf18597e7e9ac19b35a9dbfb27..5776bda3e3fa28cce92f25f6e92812a1d037e7f4 100644 (file)
@@ -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 */
index 9ed2f5d6faa7e7e79152a10d3f210b49b099cc1f..adaf0914921c41278c3cd49380244ed8843611cf 100644 (file)
@@ -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
index 95167bd45acb877b4de070967a316097d4baae97..c57d6284785a999a4bc5fc0853edca2bc71ab6db 100644 (file)
@@ -146,7 +146,7 @@ static inline int ffs (int x)
        }
        return r;
 }
-#define ffs
+#define PLATFORM_FFS
 
 #endif /* __KERNEL__ */
 
index e14e6c7b14fc1ef1595337ae58c1d7985d689d47..e724310298610bb7c1230ecff1c8d158df28c6d4 100644 (file)
@@ -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