Skip to contentSkip to conversation

linux-next: build failure after merge of the final tree (block tree related)

RFC PATCH New Stephen Rothwell 4 participants 7 messages Mar 11, 2011 – Mar 18, 2011

Subsystems (16)
Arm (32-bit) x86 VFS PowerPC +12 more subsystems
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

I have applied this patch for today (surely there is a better way):

From: Stephen Rothwell <[email protected]>
Date: Fri, 11 Mar 2011 17:54:54 +1100
Subject: [PATCH] drbd: need include for bitops functions declarations

---
 drivers/block/drbd/drbd_bitmap.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/block/drbd/drbd_bitmap.c +3 -0
index b62dd5f..f0ae63d 100644
@@ -28,6 +28,9 @@
 #include <linux/drbd.h>
 #include <linux/slab.h>
 #include <asm/kmap_types.h>
+
+#include <asm-generic/bitops/le.h>
+
 #include "drbd_int.h"
 
 
Signature · 6 lines
1.7.4.1

-- 
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
maintainer
#1 lore raw
Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Quoted 4 lines

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

I have applied this patch for today (surely there is a better way):

Thanks for not dropping it, I'll let the drbd guys send in a proper fix and get it committed.

Signature · 1 line
Jens Axboe
maintainer
#2 lore raw
Quoted 13 lines · Jens Axboe
Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Quoted 7 lines
Quoted 4 lines

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

I have applied this patch for today (surely there is a better way):

Thanks for not dropping it, I'll let the drbd guys send in a proper fix and get it committed.

Should that be fixed by adding
#include <asm-generic/bitops/le.h>
to
arch/powerpc/include/asm/bitops.h
(and arch/s390/include/asm/bitops.h, possibly others?)

Or are we expected to include that ourselves, directly?

We probably need to select CONFIG_GENERIC_FIND_NEXT_BIT from our Kconfig as well?

Lars

#3 lore raw
In reply to Jens Axboe

Hi Jens,

Quoted 13 lines · On Fri, 11 Mar 2011 08:12:38 +0100 Jens Axboe <[email protected]> wrote:
Quoted 11 lines · Stephen Rothwell

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Quoted 7 lines
Quoted 4 lines

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

I have applied this patch for today (surely there is a better way):

Thanks for not dropping it, I'll let the drbd guys send in a proper fix and get it committed.

Ping?

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
maintainer
#4 lore raw
Quoted 19 lines · Stephen Rothwell

Hi Jens,

Quoted 16 lines · On Fri, 11 Mar 2011 08:12:38 +0100 Jens Axboe <[email protected]> wrote:
Quoted 14 lines · Stephen Rothwell

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I have applied this patch for today (surely there is a better way):

Thanks for not dropping it, I'll let the drbd guys send in a proper fix and get it committed.

Ping?

Lars, please send me a fix for this ASAP. It's holding up the block merge.

Signature · 1 line
Jens Axboe
maintainer
#5 lore raw

Am Donnerstag, 17. März 2011, um 11:17:08 schrieb Jens Axboe:

Quoted 21 lines · Stephen Rothwell
Quoted 20 lines

Hi Jens,

Quoted 17 lines · On Fri, 11 Mar 2011 08:12:38 +0100 Jens Axboe <[email protected]> wrote:
Quoted 15 lines · Stephen Rothwell

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I have applied this patch for today (surely there is a better way):

Thanks for not dropping it, I'll let the drbd guys send in a proper fix and get it committed.

Ping?

Lars, please send me a fix for this ASAP. It's holding up the block merge.

Hi Jens,

Please use Stephen's patch for the merge. It is perfectly valid.

Lars is in the progress of preparing a suggestion for a much broader cleanup/fix for the little-endian bitops topic.

But that should not delay the the block merge, nor is it necessary for the drbd updates. He plans to have that ready by tomorrow.

Best,
Phil

Signature · 6 lines
: Dipl-Ing Philipp Reisner
: LINBIT | Your Way to High Availability
: Tel: +43-1-8178292-50, Fax: +43-1-8178292-82
: http://www.linbit.com

DRBD(R) and LINBIT(R) are registered trademarks of LINBIT, Austria.
maintainer
#6 lore raw

RFC PATCH 1/1 consolidate *_le_bit operations [was linux-next: build failure after merge of the final tree (block tree related)]

In reply to Jens Axboe

CC'ing fsdevel,
because ext2 and minix bit operations are affected by the proposed patch.

Quoted 17 lines · Jens Axboe
Quoted 16 lines · Stephen Rothwell

Hi Jens,

Quoted 13 lines · On Fri, 11 Mar 2011 08:12:38 +0100 Jens Axboe <[email protected]> wrote:
Quoted 11 lines · Stephen Rothwell

After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/char/tpm/tpm_tis.c:96: warning: 'is_itpm' defined but not used drivers/block/drbd/drbd_bitmap.c: In function '__bm_change_bits_to':
drivers/block/drbd/drbd_bitmap.c:1287: error: implicit declaration of function 'generic___test_and_set_le_bit' drivers/block/drbd/drbd_bitmap.c:1289: error: implicit declaration of function 'generic___test_and_clear_le_bit' drivers/block/drbd/drbd_bitmap.c: In function 'drbd_bm_test_bit':
drivers/block/drbd/drbd_bitmap.c:1438: error: implicit declaration of function 'generic_test_le_bit'

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Caused by commit 4b0715f09655 ("drbd: allow petabyte storage on 64bit arch").

I have applied this patch for today (surely there is a better way):

... explicitly including
+#include <asm-generic/bitops/le.h>

That fix is fine for DRBD from my perspective.
I'm not sure how to "measure" "better" here.
But see below.

Quoted 11 lines
Quoted 4 lines
Quoted 2 lines

Thanks for not dropping it, I'll let the drbd guys send in a proper fix and get it committed.

Ping?

Lars, please send me a fix for this ASAP. It's holding up the block merge.

Signature · 1 line
Jens Axboe

Thing is, on most architectures,
we get asm-generic/bitops/le.h included implicitly.
On some, it is missing, because they decide to provide their own re-implementation of those generic defines/functions.

let me try this:

  # git grep asm-generic/bitops/le.h
  include/asm-generic/bitops/ext2-non-atomic.h:#include <asm-generic/bitops/le.h>
  include/asm-generic/bitops/minix-le.h:#include <asm-generic/bitops/le.h>
  net/ipv6/ip6_fib.c:      * See include/asm-generic/bitops/le.h.
  net/rds/cong.c:#include <asm-generic/bitops/le.h>
  virt/kvm/kvm_main.c:#include <asm-generic/bitops/le.h>

Seems to be unusual to include this directly. But

  # git grep asm-generic/bitops/ext2-non-atomic.h
  gives: include/asm-generic/bitops.h, as well as all arch/*/include/asm/bitops.h,
  except a few. Let's see
  # grep -L -E 'asm-generic/bitops(|/(ext2-non-atomic|le))\.h' arch/*/include/asm/bitops.h | cut -d/ -f2
  arm m68k powerpc s390 sparc
  where m68k is probably a false hit, see arch/m68k/include/asm/bitops_{mm,no}.h

What should we do?
add "#include <asm-generic/bitops.h>" or "#include <asm-generic/bitops/ext2-non-atomic.h>" or something else that includes .../le.h implicitly to arch/{arm,powerpc,s390,sparc}/include/asm/bitops.h as well?

Now, while I was trying to do that,
I got the impression that many LOC could be saved by replacing repeated implementations in arch/*/bitops.h with
#include <asm-generic/bitops/ext2-non-atomic.h> #include <asm-generic/bitops/minix-le.h>

Some #define ext2_set_bit_atomic() would be left over. E.g. powerpc does
#define ext2_clear_bit_atomic(lock, nr, addr) \
test_and_clear_le_bit((nr), (unsigned long*)addr)

while asm-generic/bitops/ext2-atomic.h actually does

#define ext2_clear_bit_atomic(lock, nr, addr)		\
	({						\
		int ret;				\
		spin_lock(lock);			\
		ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \
		spin_unlock(lock);			\
		ret;					\
	})

Now, I wonder why some architectures would need and use that spinlock, if they can do test_and_clear_bit in their native endian just fine?

Why is this not generally defined as
#define ext2_clear_bit_atomic(lock, nr, addr) \
generic_test_and_clear_le_bit(nr, addr)
(or

	generic_test_and_clear_le_bit((nr), (unsigned long*)(addr))

for that matter)?

How would that be less atomic?
I am probably missing something, so please educate me.

BTW, arch/s390/include/asm/bitops.h (and sparc,m68k) looks fishy to me:
#include <asm-generic/bitops/minix.h> should probably be #include <asm-generic/bitops/minix-le.h>

or is it ok if they expect the minix bit operations to be native endian?

Why would that be ok for some archs, but not others?

Proposed patch below, I hope I did not remove too much lines ;-)

As mentioned, I'm unsure about the occurrences of minix.h vs minix-le.h. The help poor souls like me, at least they deserve a comment when to use which and why.

On parisc, I moved the include of minix-le.h inside the __KERNEL__ protection, to match the other architectures.

In a further cleanup step, we could get rid of all those lock arguments to ext2_*_atomic.

What do you think?

Lars

---
 arch/alpha/include/asm/bitops.h          |    5 +-
 arch/arm/include/asm/bitops.h            |   38 +--------
 arch/cris/include/asm/bitops.h           |    5 +-
 arch/frv/include/asm/bitops.h            |    5 +-
 arch/ia64/include/asm/bitops.h           |    5 +-
 arch/m68k/include/asm/bitops_mm.h        |  138 +-----------------------------
 arch/m68k/include/asm/bitops_no.h        |  134 +----------------------------
 arch/mn10300/include/asm/bitops.h        |    6 +-
 arch/parisc/include/asm/bitops.h         |   12 +--
 arch/powerpc/include/asm/bitops.h        |   68 +--------------
 arch/s390/include/asm/bitops.h           |  106 +----------------------
 arch/sparc/include/asm/bitops_32.h       |    2 +-
 arch/sparc/include/asm/bitops_64.h       |    9 +--
 arch/x86/include/asm/bitops.h            |    7 +--
 arch/xtensa/include/asm/bitops.h         |   15 +---
 include/asm-generic/bitops/ext2-atomic.h |   21 +----
 16 files changed, 32 insertions(+), 544 deletions(-)
include/asm-generic/bitops/ext2-atomic.h +5 -16
index ab1c875..79d6c05 100644
@@ -1,22 +1,11 @@
 #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
 #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
 
-#define ext2_set_bit_atomic(lock, nr, addr)		\
-	({						\
-		int ret;				\
-		spin_lock(lock);			\
-		ret = ext2_set_bit((nr), (unsigned long *)(addr)); \
-		spin_unlock(lock);			\
-		ret;					\
-	})
+#include <asm-generic/bitops/le.h>
 
-#define ext2_clear_bit_atomic(lock, nr, addr)		\
-	({						\
-		int ret;				\
-		spin_lock(lock);			\
-		ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \
-		spin_unlock(lock);			\
-		ret;					\
-	})
+#define ext2_set_bit_atomic(lock,nr,p)          \
+	generic_test_and_set_le_bit((nr),(unsigned long*)(p))
+#define ext2_clear_bit_atomic(lock,nr,p)        \
+	generic_test_and_clear_le_bit((nr),(unsigned long*)(p))
 
 #endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */
arch/alpha/include/asm/bitops.h +1 -4
index adfab8a..9473ad4 100644
@@ -455,10 +455,7 @@ sched_find_first_bit(const unsigned long b[2])
 }
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-
+#include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 
 #endif /* __KERNEL__ */
arch/arm/include/asm/bitops.h +3 -35
index af54ed1..1ac7ffe 100644
@@ -287,41 +287,9 @@ static inline int fls(int x)
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
 
-/*
- * Ext2 is defined to use little-endian byte ordering.
- * These do not need to be atomic.
- */
-#define ext2_set_bit(nr,p)			\
-		__test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_set_bit_atomic(lock,nr,p)          \
-                test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_clear_bit(nr,p)			\
-		__test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_clear_bit_atomic(lock,nr,p)        \
-                test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_test_bit(nr,p)			\
-		test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define ext2_find_first_zero_bit(p,sz)		\
-		_find_first_zero_bit_le(p,sz)
-#define ext2_find_next_zero_bit(p,sz,off)	\
-		_find_next_zero_bit_le(p,sz,off)
-#define ext2_find_next_bit(p, sz, off) \
-		_find_next_bit_le(p, sz, off)
-
-/*
- * Minix is defined to use little-endian byte ordering.
- * These do not need to be atomic.
- */
-#define minix_set_bit(nr,p)			\
-		__set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_test_bit(nr,p)			\
-		test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_test_and_set_bit(nr,p)		\
-		__test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_test_and_clear_bit(nr,p)		\
-		__test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
-#define minix_find_first_zero_bit(p,sz)		\
-		_find_first_zero_bit_le(p,sz)
+#include <asm-generic/bitops/ext2-non-atomic.h>
+#include <asm-generic/bitops/ext2-atomic.h>
+#include <asm-generic/bitops/minix-le.h>
 
 #endif /* __KERNEL__ */
 
arch/cris/include/asm/bitops.h +1 -4
index 9e69cfb..b4f2e42 100644
@@ -155,10 +155,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
 #include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-
+#include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 #include <asm-generic/bitops/sched.h>
 
arch/frv/include/asm/bitops.h +1 -4
index 50ae91b..04f743d 100644
@@ -402,10 +402,7 @@ int __ilog2_u64(u64 n)
 #include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(lock,nr,addr)	test_and_set_bit  ((nr) ^ 0x18, (addr))
-#define ext2_clear_bit_atomic(lock,nr,addr)	test_and_clear_bit((nr) ^ 0x18, (addr))
-
+#include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix-le.h>
 
 #endif /* __KERNEL__ */
arch/ia64/include/asm/bitops.h +1 -4
index 9da3df6..ab03fdd 100644
@@ -457,10 +457,7 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
 #ifdef __KERNEL__
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(l,n,a)	test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a)	test_and_clear_bit(n,a)
-
+#include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 #include <asm-generic/bitops/sched.h>
 
arch/m68k/include/asm/bitops_mm.h +3 -135

144 lines not on this page · raw message

arch/m68k/include/asm/bitops_no.h +3 -131

140 lines not on this page · raw message

arch/mn10300/include/asm/bitops.h +1 -5
index 3b8a868..637df7a 100644
@@ -228,12 +228,8 @@ int ffs(int x)
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
 
-#define ext2_set_bit_atomic(lock, nr, addr) \
-	test_and_set_bit((nr), (addr))
-#define ext2_clear_bit_atomic(lock, nr, addr) \
-	test_and_clear_bit((nr), (addr))
-
 #include <asm-generic/bitops/ext2-non-atomic.h>
+#include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix-le.h>
 
 #endif /* __KERNEL__ */
arch/parisc/include/asm/bitops.h +2 -10
index 7a6ea10..8e2a6da 100644
@@ -223,17 +223,9 @@ static __inline__ int fls(int x)
 #ifdef __KERNEL__
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-/* '3' is bits per byte */
-#define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3)
-
-#define ext2_set_bit_atomic(l,nr,addr) \
-		test_and_set_bit((nr)   ^ LE_BYTE_ADDR, (unsigned long *)addr)
-#define ext2_clear_bit_atomic(l,nr,addr) \
-		test_and_clear_bit( (nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
+#include <asm-generic/bitops/ext2-atomic.h>
+#include <asm-generic/bitops/minix-le.h>
 
 #endif	/* __KERNEL__ */
 
-#include <asm-generic/bitops/minix-le.h>
-
 #endif /* _PARISC_BITOPS_H */
arch/powerpc/include/asm/bitops.h +3 -65

74 lines not on this page · raw message

arch/s390/include/asm/bitops.h +3 -103

112 lines not on this page · raw message

arch/sparc/include/asm/bitops_32.h +1 -1
index 9cf4ae0..f84c6d3 100644
@@ -105,7 +105,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
-#include <asm-generic/bitops/minix.h>
+#include <asm-generic/bitops/minix-le.h>
 
 #endif /* __KERNEL__ */
 
arch/sparc/include/asm/bitops_64.h +2 -7
index 766121a..cb42dc6 100644
@@ -90,13 +90,8 @@ static inline unsigned int __arch_hweight8(unsigned int w)
 #ifdef __KERNEL__
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(lock,nr,addr) \
-	test_and_set_bit((nr) ^ 0x38,(unsigned long *)(addr))
-#define ext2_clear_bit_atomic(lock,nr,addr) \
-	test_and_clear_bit((nr) ^ 0x38,(unsigned long *)(addr))
-
-#include <asm-generic/bitops/minix.h>
+#include <asm-generic/bitops/ext2-atomic.h>
+#include <asm-generic/bitops/minix-le.h>
 
 #endif /* __KERNEL__ */
 
arch/x86/include/asm/bitops.h +1 -6
index 903683b..42b8401 100644
@@ -457,12 +457,7 @@ static inline int fls(int x)
 #ifdef __KERNEL__
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(lock, nr, addr)			\
-	test_and_set_bit((nr), (unsigned long *)(addr))
-#define ext2_clear_bit_atomic(lock, nr, addr)			\
-	test_and_clear_bit((nr), (unsigned long *)(addr))
-
+#include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
 
 #endif /* __KERNEL__ */
arch/xtensa/include/asm/bitops.h +1 -14
index 6c39303..355af09 100644
@@ -107,20 +107,7 @@ static inline unsigned long __fls(unsigned long word)
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
-
-#ifdef __XTENSA_EL__
-# define ext2_set_bit_atomic(lock,nr,addr)				\
-	test_and_set_bit((nr), (unsigned long*)(addr))
-# define ext2_clear_bit_atomic(lock,nr,addr)				\
-	test_and_clear_bit((nr), (unsigned long*)(addr))
-#elif defined(__XTENSA_EB__)
-# define ext2_set_bit_atomic(lock,nr,addr)				\
-	test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr))
-# define ext2_clear_bit_atomic(lock,nr,addr)				\
-	test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr))
-#else
-# error processor byte order undefined!
-#endif
+#include <asm-generic/bitops/ext2-atomic.h>
 
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>