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>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
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 @@
 }
 
 /*
- * 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 @@
 	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 @@
 }
 
 /*
- * 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 @@
 		"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 @@
 	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 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 @@
 	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 @@
 
 	*m |= 1UL << (nr & 31);
 }
-#define __set_bit
+#define PLATFORM__SET_BIT
 
 /*
  * clear_bit - Clears a bit in memory
@@ -706,17 +706,6 @@
 
 #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_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_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 @@
 {
 	return __ilog2(x) + 1;
 }
-#define fls
+#define PLATFORM_FLS
 
 /**
  * fls64 - find last set bit in a 64-bit word
@@ -231,7 +231,7 @@
 {
 	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 @@
 	}
 	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 @@
 
 /* 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