bitops: introduce CONFIG_GENERIC_FIND_BIT_LE
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 23 Mar 2011 23:41:59 +0000 (16:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 02:46:14 +0000 (19:46 -0700)
This introduces CONFIG_GENERIC_FIND_BIT_LE to tell whether to use generic
implementation of find_*_bit_le() in lib/find_next_bit.c or not.

For now we select CONFIG_GENERIC_FIND_BIT_LE for all architectures which
enable CONFIG_GENERIC_FIND_NEXT_BIT.

But m68knommu wants to define own faster find_next_zero_bit_le() and
continues using generic find_next_{,zero_}bit().
(CONFIG_GENERIC_FIND_NEXT_BIT and !CONFIG_GENERIC_FIND_BIT_LE)

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 files changed:
arch/frv/Kconfig
arch/h8300/Kconfig
arch/m32r/Kconfig
arch/m68knommu/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/xtensa/Kconfig
lib/Kconfig
lib/Makefile
lib/find_next_bit.c

index 747499a1b31ef709fb42bed7f0c0acca23a07a74..f6037b2da25ef6f9af5ed31187afac45058c7256 100644 (file)
@@ -22,6 +22,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_HWEIGHT
        bool
        default y
index 6df692d1475f7ffb2549ab62929374a2daafcb54..9624db193e3cef301598f0c56e545c9f6d2fe7a4 100644 (file)
@@ -45,6 +45,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_HWEIGHT
        bool
        default y
index ef4c1e442be34a4d9c3289e1b5b9d7b262617047..62afe23c9a49b9f3a645269f5a819f5f913ba310 100644 (file)
@@ -260,6 +260,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_HWEIGHT
        bool
        default y
index b5424cf948e64430ccdd635c17c1fdfa892e42b8..5795f58728ca884ce9c30b4cfb87e3080dd138ed 100644 (file)
@@ -42,6 +42,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_GPIO
        bool
        default n
index 922c4194c7bb909c493716d1d48a4bceb8b714f9..5f0cf0e32653e30931b5039134ca339287f5c586 100644 (file)
@@ -37,6 +37,9 @@ config ARCH_HAS_ILOG2_U64
 config GENERIC_FIND_NEXT_BIT
        def_bool y
 
+config GENERIC_FIND_BIT_LE
+       def_bool y
+
 config GENERIC_HWEIGHT
        def_bool y
 
index d88983516e26118bff775f8d9c87f58e8163a88f..6e9811d40c9f57310af68020490a32fe09073a49 100644 (file)
@@ -777,6 +777,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_HWEIGHT
        bool
        default y
index fafdf30bea9e5fc040f0c629078680716a8caf50..9b1f427cdc3762b928aa6675f584b023eb82aea9 100644 (file)
@@ -52,6 +52,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_BUG
        bool
        default y
index 71ba04721bebadb58132125da79b605c13a09d4f..ce9ff55e1026ed653cb2eb3086677f77a1f93af7 100644 (file)
@@ -95,6 +95,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_GPIO
        bool
        help
index 2d264fa84959dde3488b79c8d0fd111b5df63a7e..1fbf0c7583d07ed48495886d57a7f14e25318a2e 100644 (file)
@@ -75,6 +75,9 @@ config GENERIC_CSUM
 config GENERIC_FIND_NEXT_BIT
        def_bool y
 
+config GENERIC_FIND_BIT_LE
+       def_bool y
+
 config GENERIC_HWEIGHT
        def_bool y
 
index e48f471be547109b04e4d2124ff8b4c9498a3fad..f766e6bf370ebb2e8972a0cbdfd28b54f752d97c 100644 (file)
@@ -192,6 +192,10 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_FIND_BIT_LE
+       bool
+       default y
+
 config GENERIC_HWEIGHT
        bool
        default y if !ULTRA_HAS_POPULATION_COUNT
index d373d159e75e408eef28e722cc8401885e9ffd0a..72839190f5031ceffe64eb2249df73c377e2517c 100644 (file)
@@ -21,6 +21,9 @@ config RWSEM_XCHGADD_ALGORITHM
 config GENERIC_FIND_NEXT_BIT
        def_bool y
 
+config GENERIC_FIND_BIT_LE
+       def_bool y
+
 config GENERIC_HWEIGHT
        def_bool y
 
index 3a55a43c43ebb2dce87b15bf0a8bf2579cea1c84..23fa7a359db74008cbbb7d17599edcd480d76a97 100644 (file)
@@ -22,6 +22,9 @@ config GENERIC_FIND_FIRST_BIT
 config GENERIC_FIND_NEXT_BIT
        bool
 
+config GENERIC_FIND_BIT_LE
+       bool
+
 config GENERIC_FIND_LAST_BIT
        bool
        default y
index 8c9de027ebb14f716b6a51215e41e7e49e77f4b3..d7872b5c4c1c375d92b5dd7468636a132932ca8f 100644 (file)
@@ -40,6 +40,7 @@ lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
 lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
 lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
+lib-$(CONFIG_GENERIC_FIND_BIT_LE) += find_next_bit.o
 obj-$(CONFIG_GENERIC_FIND_LAST_BIT) += find_last_bit.o
 
 CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
index 7667c3d907d31ec8eea184fadd764038ec498d17..b0a8767282bf674fe980f17b5d192103e5ffc4f5 100644 (file)
@@ -160,6 +160,7 @@ EXPORT_SYMBOL(find_first_zero_bit);
 #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
 
 #ifdef __BIG_ENDIAN
+#ifdef CONFIG_GENERIC_FIND_BIT_LE
 
 /* include/linux/byteorder does not support "unsigned long" type */
 static inline unsigned long ext2_swabp(const unsigned long * x)
@@ -273,4 +274,6 @@ found_middle_swap:
        return result + __ffs(ext2_swab(tmp));
 }
 EXPORT_SYMBOL(find_next_bit_le);
+
+#endif /* CONFIG_GENERIC_FIND_BIT_LE */
 #endif /* __BIG_ENDIAN */