LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH -mm 0/6] convert little-endian bitops macros to inline functions
@ 2011-01-27 13:56 Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 1/6] asm-generic: convert little-endian bitops macros to static " Akinobu Mita
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm; +Cc: Akinobu Mita

The little-endian bitops patch series has been added to the -mm tree.
This additional patch series converts all little-endian bitops macros
to static inline functions with proper prototypes.

Akinobu Mita (6):
  asm-generic: convert little-endian bitops macros to static inline
    functions
  powerpc: convert little-endian bitops macros to static inline
    functions
  s390: convert little-endian bitops macros to static inline functions
  arm: convert little-endian bitops macros to static inline functions
  m68k: convert little-endian bitops macros to static inline functions
  m68knommu: convert little-endian bitops macros to static inline
    functions

 arch/arm/include/asm/bitops.h     |   70 +++++++++++++++++++++++++----------
 arch/m68k/include/asm/bitops_mm.h |   41 +++++++++++++++------
 arch/m68k/include/asm/bitops_no.h |   12 ++++--
 arch/powerpc/include/asm/bitops.h |   43 +++++++++++++++-------
 arch/s390/include/asm/bitops.h    |   48 +++++++++++++++++-------
 include/asm-generic/bitops/le.h   |   73 ++++++++++++++++++++++++++-----------
 6 files changed, 201 insertions(+), 86 deletions(-)

-- 
1.7.3.4


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

* [PATCH -mm 1/6] asm-generic: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
@ 2011-01-27 13:56 ` Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 2/6] powerpc: " Akinobu Mita
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm
  Cc: Akinobu Mita, Linus Torvalds, Arnd Bergmann, Richard Henderson,
	Ivan Kokshaysky, Mikael Starvik, David Howells, Yoshinori Sato,
	Luck, Tony, Ralf Baechle, Kyle McMartin, Matthew Wilcox,
	Grant Grundler, Paul Mundt, Kazumoto Kojima, Hirokazu Takata,
	David S. Miller, Chris Zankel, Ingo Molnar, Thomas Gleixner,
	Hans-Christian Egtvedt, H. Peter Anvin, Benjamin Herrenschmidt,
	Paul Mackerras

(This patch is intended to be folded into the patch in -mm:
asm-generic-change-little-endian-bitops-to-take-any-pointer-types.patch)

The little-endian bitops on asm-generic are written as preprocessor
macros with the cast to "unsigned long *".
This means that even non-pointers will be accepted without an error, and
that is a Very Bad Thing.

This converts the little-endian bitops macros to static inline functions
with proper prototypes.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Zankel <chris@zankel.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
---
 include/asm-generic/bitops/le.h |   73 +++++++++++++++++++++++++++------------
 1 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 7644a15..946a21b 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -8,12 +8,23 @@
 
 #define BITOP_LE_SWIZZLE	0
 
-#define find_next_zero_bit_le(addr, size, offset) \
-	find_next_zero_bit((unsigned long *)(addr), size, offset)
-#define find_next_bit_le(addr, size, offset) \
-	find_next_bit((unsigned long *)(addr), size, offset)
-#define find_first_zero_bit_le(addr, size) \
-	find_first_zero_bit((unsigned long *)(addr), size)
+static inline unsigned long find_next_zero_bit_le(const void *addr,
+		unsigned long size, unsigned long offset)
+{
+	return find_next_zero_bit(addr, size, offset);
+}
+
+static inline unsigned long find_next_bit_le(const void *addr,
+		unsigned long size, unsigned long offset)
+{
+	return find_next_bit(addr, size, offset);
+}
+
+static inline unsigned long find_first_zero_bit_le(const void *addr,
+		unsigned long size)
+{
+	return find_first_zero_bit(addr, size);
+}
 
 #elif defined(__BIG_ENDIAN)
 
@@ -31,21 +42,39 @@ extern unsigned long find_next_bit_le(const void *addr,
 #error "Please fix <asm/byteorder.h>"
 #endif
 
-#define test_bit_le(nr, addr) \
-	test_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define __set_bit_le(nr, addr) \
-	__set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define __clear_bit_le(nr, addr) \
-	__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-
-#define test_and_set_bit_le(nr, addr) \
-	test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define test_and_clear_bit_le(nr, addr) \
-	test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-
-#define __test_and_set_bit_le(nr, addr) \
-	__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define __test_and_clear_bit_le(nr, addr) \
-	__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
+static inline int test_bit_le(int nr, const void *addr)
+{
+	return test_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void __set_bit_le(int nr, void *addr)
+{
+	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void __clear_bit_le(int nr, void *addr)
+{
+	__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int test_and_set_bit_le(int nr, void *addr)
+{
+	return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int test_and_clear_bit_le(int nr, void *addr)
+{
+	return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int __test_and_set_bit_le(int nr, void *addr)
+{
+	return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int __test_and_clear_bit_le(int nr, void *addr)
+{
+	return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
 
 #endif /* _ASM_GENERIC_BITOPS_LE_H_ */
-- 
1.7.3.4


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

* [PATCH -mm 2/6] powerpc: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 1/6] asm-generic: convert little-endian bitops macros to static " Akinobu Mita
@ 2011-01-27 13:56 ` Akinobu Mita
  2011-02-06 23:14   ` Benjamin Herrenschmidt
  2011-01-27 13:56 ` [PATCH -mm 3/6] s390: " Akinobu Mita
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm
  Cc: Akinobu Mita, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

(This patch is intended to be folded into the patch in -mm:
powerpc-introduce-little-endian-bitops.patch)

The little-endian bitops on powerpc are written as preprocessor
macros with the cast to "unsigned long *".
This means that even non-pointers will be accepted without an error, and
that is a Very Bad Thing.

This converts the little-endian bitops macros to static inline functions
with proper prototypes.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/include/asm/bitops.h |   43 +++++++++++++++++++++++++------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index fe67024..2e56187 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -288,20 +288,35 @@ static __inline__ int test_bit_le(unsigned long nr,
 	return (tmp[nr >> 3] >> (nr & 7)) & 1;
 }
 
-#define __set_bit_le(nr, addr) \
-	__set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define __clear_bit_le(nr, addr) \
-	__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-
-#define test_and_set_bit_le(nr, addr) \
-	test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define test_and_clear_bit_le(nr, addr) \
-	test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-
-#define __test_and_set_bit_le(nr, addr) \
-	__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
-#define __test_and_clear_bit_le(nr, addr) \
-	__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
+static inline void __set_bit_le(int nr, void *addr)
+{
+	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void __clear_bit_le(int nr, void *addr)
+{
+	__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int test_and_set_bit_le(int nr, void *addr)
+{
+	return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int test_and_clear_bit_le(int nr, void *addr)
+{
+	return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int __test_and_set_bit_le(int nr, void *addr)
+{
+	return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline int __test_and_clear_bit_le(int nr, void *addr)
+{
+	return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
 
 #define find_first_zero_bit_le(addr, size) \
 	find_next_zero_bit_le((addr), (size), 0)
-- 
1.7.3.4


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

* [PATCH -mm 3/6] s390: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 1/6] asm-generic: convert little-endian bitops macros to static " Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 2/6] powerpc: " Akinobu Mita
@ 2011-01-27 13:56 ` Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 4/6] arm: " Akinobu Mita
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm
  Cc: Akinobu Mita, Arnd Bergmann, Martin Schwidefsky, Heiko Carstens

(This patch is intended to be folded into the patch in -mm:
s390-introduce-little-endian-bitops.patch)

The little-endian bitops on s390 are written as preprocessor
macros with the cast to "unsigned long *".
This means that even non-pointers will be accepted without an error, and
that is a Very Bad Thing.

This converts the little-endian bitops macros to static inline functions
with proper prototypes.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 arch/s390/include/asm/bitops.h |   48 ++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 6528b22..e1c8f3a 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -742,20 +742,40 @@ static inline int sched_find_first_bit(unsigned long *b)
  *    23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
  */
 
-#define __set_bit_le(nr, addr)	\
-	__set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
-#define __clear_bit_le(nr, addr)	\
-	__clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
-#define __test_and_set_bit_le(nr, addr)	\
-	__test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
-#define test_and_set_bit_le(nr, addr)	\
-	test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
-#define __test_and_clear_bit_le(nr, addr)	\
-	__test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
-#define test_and_clear_bit_le(nr, addr)	\
-	test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
-#define test_bit_le(nr, addr)	\
-	test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)(addr))
+static inline void __set_bit_le(unsigned long nr, void *addr)
+{
+	__set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
+
+static inline void __clear_bit_le(unsigned long nr, void *addr)
+{
+	__clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
+
+static inline int __test_and_set_bit_le(unsigned long nr, void *addr)
+{
+	return __test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
+
+static inline int test_and_set_bit_le(unsigned long nr, void *addr)
+{
+	return test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
+
+static inline int __test_and_clear_bit_le(unsigned long nr, void *addr)
+{
+	return __test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
+
+static inline int test_and_clear_bit_le(unsigned long nr, void *addr)
+{
+	return test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
+
+static inline int test_bit_le(unsigned long nr, const void *addr)
+{
+	return test_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
+}
 
 static inline int find_first_zero_bit_le(void *vaddr, unsigned int size)
 {
-- 
1.7.3.4


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

* [PATCH -mm 4/6] arm: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
                   ` (2 preceding siblings ...)
  2011-01-27 13:56 ` [PATCH -mm 3/6] s390: " Akinobu Mita
@ 2011-01-27 13:56 ` Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 5/6] m68k: " Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 6/6] m68knommu: " Akinobu Mita
  5 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm; +Cc: Akinobu Mita, Russell King

(This patch is intended to be folded into the patch in -mm:
arm-introduce-little-endian-bitops.patch)

The little-endian bitops on arm are written as preprocessor
macros with the cast to "unsigned long *".
This means that even non-pointers will be accepted without an error, and
that is a Very Bad Thing.

This converts the little-endian bitops macros to static inline functions
with proper prototypes.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/include/asm/bitops.h |   70 +++++++++++++++++++++++++++++------------
 1 files changed, 50 insertions(+), 20 deletions(-)

diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 56d6b54..f530d59 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -303,26 +303,56 @@ static inline int fls(int x)
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
 
-#define __set_bit_le(nr, p)			\
-	__set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define __clear_bit_le(nr, p)			\
-	__clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define __test_and_set_bit_le(nr, p)			\
-		__test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define test_and_set_bit_le(nr, p)          \
-		test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define __test_and_clear_bit_le(nr, p)			\
-		__test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define test_and_clear_bit_le(nr, p)	\
-		test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define test_bit_le(nr, p)			\
-		test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define find_first_zero_bit_le(p, sz)		\
-		_find_first_zero_bit_le(p, sz)
-#define find_next_zero_bit_le(p, sz, off)	\
-		_find_next_zero_bit_le(p, sz, off)
-#define find_next_bit_le(p, sz, off) \
-		_find_next_bit_le((unsigned long *)(p), sz, off)
+static inline void __set_bit_le(int nr, void *addr)
+{
+	__set_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline void __clear_bit_le(int nr, void *addr)
+{
+	__clear_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline int __test_and_set_bit_le(int nr, void *addr)
+{
+	return __test_and_set_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline int test_and_set_bit_le(int nr, void *addr)
+{
+	return test_and_set_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline int __test_and_clear_bit_le(int nr, void *addr)
+{
+	return __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline int test_and_clear_bit_le(int nr, void *addr)
+{
+	return test_and_clear_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline int test_bit_le(int nr, const void *addr)
+{
+	return test_bit(WORD_BITOFF_TO_LE(nr), addr);
+}
+
+static inline int find_first_zero_bit_le(const void *p, unsigned size)
+{
+	return _find_first_zero_bit_le(p, size);
+}
+
+static inline int find_next_zero_bit_le(const void *p, int size, int offset)
+{
+	return _find_next_zero_bit_le(p, size, offset);
+}
+
+static inline int find_next_bit_le(const void *p, int size, int offset)
+{
+	return _find_next_bit_le(p, size, offset);
+}
+
 /*
  * Ext2 is defined to use little-endian byte ordering.
  */
-- 
1.7.3.4


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

* [PATCH -mm 5/6] m68k: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
                   ` (3 preceding siblings ...)
  2011-01-27 13:56 ` [PATCH -mm 4/6] arm: " Akinobu Mita
@ 2011-01-27 13:56 ` Akinobu Mita
  2011-01-27 13:56 ` [PATCH -mm 6/6] m68knommu: " Akinobu Mita
  5 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm
  Cc: Akinobu Mita, Geert Uytterhoeven, Roman Zippel, Andreas Schwab

(This patch is intended to be folded into the patch in -mm:
m68k-introduce-little-endian-bitops.patch)

The little-endian bitops on m68k are written as preprocessor
macros with the cast to "unsigned long *".
This means that even non-pointers will be accepted without an error, and
that is a Very Bad Thing.

This converts the little-endian bitops macros to static inline functions
with proper prototypes.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
---
 arch/m68k/include/asm/bitops_mm.h |   41 ++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 1177a48..9d69f6e 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -327,18 +327,35 @@ static inline int __fls(int x)
 
 /* Bitmap functions for the little endian bitmap. */
 
-#define __set_bit_le(nr, addr)	\
-	__set_bit((nr) ^ 24, (unsigned long *)(addr))
-#define __clear_bit_le(nr, addr)	\
-	__clear_bit((nr) ^ 24, (unsigned long *)(addr))
-#define __test_and_set_bit_le(nr, addr)	\
-	__test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
-#define test_and_set_bit_le(nr, addr)	\
-	test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
-#define __test_and_clear_bit_le(nr, addr)	\
-	__test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
-#define test_and_clear_bit_le(nr, addr)	\
-	test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
+static inline void __set_bit_le(int nr, void *addr)
+{
+	__set_bit(nr ^ 24, addr);
+}
+
+static inline void __clear_bit_le(int nr, void *addr)
+{
+	__clear_bit(nr ^ 24, addr);
+}
+
+static inline int __test_and_set_bit_le(int nr, void *addr)
+{
+	return __test_and_set_bit(nr ^ 24, addr);
+}
+
+static inline int test_and_set_bit_le(int nr, void *addr)
+{
+	return test_and_set_bit(nr ^ 24, addr);
+}
+
+static inline int __test_and_clear_bit_le(int nr, void *addr)
+{
+	return __test_and_clear_bit(nr ^ 24, addr);
+}
+
+static inline int test_and_clear_bit_le(int nr, void *addr)
+{
+	return test_and_clear_bit(nr ^ 24, addr);
+}
 
 static inline int test_bit_le(int nr, const void *vaddr)
 {
-- 
1.7.3.4


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

* [PATCH -mm 6/6] m68knommu: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
                   ` (4 preceding siblings ...)
  2011-01-27 13:56 ` [PATCH -mm 5/6] m68k: " Akinobu Mita
@ 2011-01-27 13:56 ` Akinobu Mita
  2011-01-28  0:36   ` Greg Ungerer
  5 siblings, 1 reply; 10+ messages in thread
From: Akinobu Mita @ 2011-01-27 13:56 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm
  Cc: Akinobu Mita, Greg Ungerer, Greg Ungerer, Geert Uytterhoeven,
	Roman Zippel, Andreas Schwab

(This patch is intended to be folded into the patch in -mm:
m68knommu-introduce-little-endian-bitops.patch)

A few little-endian bitops on m68knommu are written as preprocessor
macros with the cast to "unsigned long *".
This means that even non-pointers will be accepted without an error, and
that is a Very Bad Thing.

This converts the little-endian bitops macros to static inline functions
with proper prototypes.

Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
---
 arch/m68k/include/asm/bitops_no.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index c5f5a78..7d3779f 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -198,11 +198,15 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
 
 #define BITOP_LE_SWIZZLE	((BITS_PER_LONG-1) & ~0x7)
 
-#define __set_bit_le(nr, addr) \
-	__set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
+static inline void __set_bit_le(int nr, void *addr)
+{
+	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
 
-#define __clear_bit_le(nr, addr) \
-	__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
+static inline void __clear_bit_le(int nr, void *addr)
+{
+	__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
 
 static inline int __test_and_set_bit_le(int nr, volatile void *addr)
 {
-- 
1.7.3.4


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

* Re: [PATCH -mm 6/6] m68knommu: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 ` [PATCH -mm 6/6] m68knommu: " Akinobu Mita
@ 2011-01-28  0:36   ` Greg Ungerer
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Ungerer @ 2011-01-28  0:36 UTC (permalink / raw)
  To: Akinobu Mita
  Cc: linux-kernel, linux-arch, akpm, Greg Ungerer, Geert Uytterhoeven,
	Roman Zippel, Andreas Schwab

On 27/01/11 23:56, Akinobu Mita wrote:
> (This patch is intended to be folded into the patch in -mm:
> m68knommu-introduce-little-endian-bitops.patch)
>
> A few little-endian bitops on m68knommu are written as preprocessor
> macros with the cast to "unsigned long *".
> This means that even non-pointers will be accepted without an error, and
> that is a Very Bad Thing.
>
> This converts the little-endian bitops macros to static inline functions
> with proper prototypes.
>
> Suggested-by: "H. Peter Anvin"<hpa@zytor.com>
> Signed-off-by: Akinobu Mita<akinobu.mita@gmail.com>
> Cc: Greg Ungerer<gerg@uclinux.org>
> Cc: Greg Ungerer<gerg@snapgear.com>

You drop both of these "CC"'s and add:

Acked-by: Greg Ungerer <gerg@uclinux.org>


> Cc: Geert Uytterhoeven<geert@linux-m68k.org>
> Cc: Roman Zippel<zippel@linux-m68k.org>
> Cc: Andreas Schwab<schwab@linux-m68k.org>
> ---
>   arch/m68k/include/asm/bitops_no.h |   12 ++++++++----
>   1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
> index c5f5a78..7d3779f 100644
> --- a/arch/m68k/include/asm/bitops_no.h
> +++ b/arch/m68k/include/asm/bitops_no.h
> @@ -198,11 +198,15 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
>
>   #define BITOP_LE_SWIZZLE	((BITS_PER_LONG-1)&  ~0x7)
>
> -#define __set_bit_le(nr, addr) \
> -	__set_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
> +static inline void __set_bit_le(int nr, void *addr)
> +{
> +	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
> +}
>
> -#define __clear_bit_le(nr, addr) \
> -	__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (unsigned long *)(addr))
> +static inline void __clear_bit_le(int nr, void *addr)
> +{
> +	__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
> +}
>
>   static inline int __test_and_set_bit_le(int nr, volatile void *addr)
>   {


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

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

* Re: [PATCH -mm 2/6] powerpc: convert little-endian bitops macros to static inline functions
  2011-01-27 13:56 ` [PATCH -mm 2/6] powerpc: " Akinobu Mita
@ 2011-02-06 23:14   ` Benjamin Herrenschmidt
  2011-02-07  3:08     ` Akinobu Mita
  0 siblings, 1 reply; 10+ messages in thread
From: Benjamin Herrenschmidt @ 2011-02-06 23:14 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, linux-arch, akpm, Paul Mackerras, linuxppc-dev

On Thu, 2011-01-27 at 22:56 +0900, Akinobu Mita wrote:
> (This patch is intended to be folded into the patch in -mm:
> powerpc-introduce-little-endian-bitops.patch)
> 
> The little-endian bitops on powerpc are written as preprocessor
> macros with the cast to "unsigned long *".
> This means that even non-pointers will be accepted without an error, and
> that is a Very Bad Thing.
> 
> This converts the little-endian bitops macros to static inline functions
> with proper prototypes.

No objection to the powerpc variant of the patches. What is the status
with the wholes series tho ? Does it looks like its going to be
accepted ? Do you expect my Ack and will merge the whole thing at once ?
Does it break bisection unless it's merged as one single giant patch ?

Cheers,
Ben.


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

* Re: [PATCH -mm 2/6] powerpc: convert little-endian bitops macros to static inline functions
  2011-02-06 23:14   ` Benjamin Herrenschmidt
@ 2011-02-07  3:08     ` Akinobu Mita
  0 siblings, 0 replies; 10+ messages in thread
From: Akinobu Mita @ 2011-02-07  3:08 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-kernel, linux-arch, akpm, Paul Mackerras, linuxppc-dev

2011/2/7 Benjamin Herrenschmidt <benh@kernel.crashing.org>:
> On Thu, 2011-01-27 at 22:56 +0900, Akinobu Mita wrote:
>> (This patch is intended to be folded into the patch in -mm:
>> powerpc-introduce-little-endian-bitops.patch)
>>
>> The little-endian bitops on powerpc are written as preprocessor
>> macros with the cast to "unsigned long *".
>> This means that even non-pointers will be accepted without an error, and
>> that is a Very Bad Thing.
>>
>> This converts the little-endian bitops macros to static inline functions
>> with proper prototypes.
>
> No objection to the powerpc variant of the patches. What is the status
> with the wholes series tho ? Does it looks like its going to be
> accepted ? Do you expect my Ack and will merge the whole thing at once ?

The whole series now seems acceptable since I fixed two issues
that Linus found annoying. (the naming and the change of prototype)

Please give your ack if it is OK.

I should have fixed them quickly so that the series went upstream
in the last merge windows. But I couldn't because I spent some time
fixing and compile testing for a bisection hole.

> Does it break bisection unless it's merged as one single giant patch ?

I think there is no known problem that breaks bisectability by
this patch series.

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

end of thread, other threads:[~2011-02-07  3:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 13:56 [PATCH -mm 0/6] convert little-endian bitops macros to inline functions Akinobu Mita
2011-01-27 13:56 ` [PATCH -mm 1/6] asm-generic: convert little-endian bitops macros to static " Akinobu Mita
2011-01-27 13:56 ` [PATCH -mm 2/6] powerpc: " Akinobu Mita
2011-02-06 23:14   ` Benjamin Herrenschmidt
2011-02-07  3:08     ` Akinobu Mita
2011-01-27 13:56 ` [PATCH -mm 3/6] s390: " Akinobu Mita
2011-01-27 13:56 ` [PATCH -mm 4/6] arm: " Akinobu Mita
2011-01-27 13:56 ` [PATCH -mm 5/6] m68k: " Akinobu Mita
2011-01-27 13:56 ` [PATCH -mm 6/6] m68knommu: " Akinobu Mita
2011-01-28  0:36   ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).