diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-12-02 16:54:21 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-12-02 16:54:21 +1100 |
commit | 1ffe645aa7ca6679e0d454af6001180f479a2797 (patch) | |
tree | b30bec4a1a0e12d5011daa0ad8a410b74976707e | |
parent | d3e53e4d33fb9f81b39b7f79c211347270ee3385 (diff) |
Revert "bitmap:find_last_bit"
This reverts commit 352102898a13616e6f9248c38ffe6dbf9ed4016b.
-rw-r--r-- | include/linux/bitops.h | 13 | ||||
-rw-r--r-- | lib/Kconfig | 4 | ||||
-rw-r--r-- | lib/Makefile | 1 | ||||
-rw-r--r-- | lib/find_next_bit.c | 31 |
4 files changed, 1 insertions, 48 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 61829139795a..024f2b027244 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -134,19 +134,8 @@ extern unsigned long find_first_bit(const unsigned long *addr, */ extern unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size); -#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ -#ifdef CONFIG_GENERIC_FIND_LAST_BIT -/** - * find_last_bit - find the last set bit in a memory region - * @addr: The address to start the search at - * @size: The maximum size to search - * - * Returns the bit number of the first set bit, or size. - */ -extern unsigned long find_last_bit(const unsigned long *addr, - unsigned long size); -#endif /* CONFIG_GENERIC_FIND_LAST_BIT */ +#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ #ifdef CONFIG_GENERIC_FIND_NEXT_BIT diff --git a/lib/Kconfig b/lib/Kconfig index fc5f5ee50bc2..2ba43c4a5b07 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -13,10 +13,6 @@ config GENERIC_FIND_FIRST_BIT config GENERIC_FIND_NEXT_BIT bool -config GENERIC_FIND_LAST_BIT - bool - default y - config CRC_CCITT tristate "CRC-CCITT functions" help diff --git a/lib/Makefile b/lib/Makefile index 0a65a53ae56f..80fe8a3ec12a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -37,7 +37,6 @@ 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_LAST_BIT) += find_next_bit.o obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o obj-$(CONFIG_PLIST) += plist.o diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c index 0fc495273924..24c59ded47a0 100644 --- a/lib/find_next_bit.c +++ b/lib/find_next_bit.c @@ -159,37 +159,6 @@ found: EXPORT_SYMBOL(find_first_zero_bit); #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ -#ifdef CONFIG_GENERIC_FIND_LAST_BIT -unsigned long find_last_bit(const unsigned long *addr, unsigned long size) -{ - unsigned long words; - unsigned long tmp; - - /* Start at final word. */ - words = size / BITS_PER_LONG; - - /* Partial final word? */ - if (size & (BITS_PER_LONG-1)) { - tmp = (addr[words] & (~0UL >> (BITS_PER_LONG - - (size & (BITS_PER_LONG-1))))); - if (tmp) - goto found; - } - - while (words) { - tmp = addr[--words]; - if (tmp) { -found: - return words * BITS_PER_LONG + __fls(tmp); - } - } - - /* Not found */ - return size; -} -EXPORT_SYMBOL(find_last_bit); -#endif /* CONFIG_GENERIC_FIND_LAST_BIT */ - #ifdef __BIG_ENDIAN /* include/linux/byteorder does not support "unsigned long" type */ |