aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/tile/include/asm/bitops.h1
-rw-r--r--arch/x86/include/asm/bitops.h2
-rw-r--r--include/asm-generic/bitops/find.h25
-rw-r--r--include/linux/bitops.h22
4 files changed, 28 insertions, 22 deletions
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h
index 6832b4be8990..6d4f0ff2c68c 100644
--- a/arch/tile/include/asm/bitops.h
+++ b/arch/tile/include/asm/bitops.h
@@ -120,6 +120,7 @@ static inline unsigned long __arch_hweight64(__u64 w)
120 120
121#include <asm-generic/bitops/const_hweight.h> 121#include <asm-generic/bitops/const_hweight.h>
122#include <asm-generic/bitops/lock.h> 122#include <asm-generic/bitops/lock.h>
123#include <asm-generic/bitops/find.h>
123#include <asm-generic/bitops/sched.h> 124#include <asm-generic/bitops/sched.h>
124#include <asm-generic/bitops/ext2-non-atomic.h> 125#include <asm-generic/bitops/ext2-non-atomic.h>
125#include <asm-generic/bitops/minix.h> 126#include <asm-generic/bitops/minix.h>
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index bafd80defa43..903683b07e42 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -440,6 +440,8 @@ static inline int fls(int x)
440 440
441#ifdef __KERNEL__ 441#ifdef __KERNEL__
442 442
443#include <asm-generic/bitops/find.h>
444
443#include <asm-generic/bitops/sched.h> 445#include <asm-generic/bitops/sched.h>
444 446
445#define ARCH_HAS_FAST_MULTIPLIER 1 447#define ARCH_HAS_FAST_MULTIPLIER 1
diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
index 1914e9742512..30afec0db7d7 100644
--- a/include/asm-generic/bitops/find.h
+++ b/include/asm-generic/bitops/find.h
@@ -9,7 +9,32 @@ extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
9 long size, unsigned long offset); 9 long size, unsigned long offset);
10#endif 10#endif
11 11
12#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
13
14/**
15 * find_first_bit - find the first set bit in a memory region
16 * @addr: The address to start the search at
17 * @size: The maximum size to search
18 *
19 * Returns the bit number of the first set bit.
20 */
21extern unsigned long find_first_bit(const unsigned long *addr,
22 unsigned long size);
23
24/**
25 * find_first_zero_bit - find the first cleared bit in a memory region
26 * @addr: The address to start the search at
27 * @size: The maximum size to search
28 *
29 * Returns the bit number of the first cleared bit.
30 */
31extern unsigned long find_first_zero_bit(const unsigned long *addr,
32 unsigned long size);
33#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
34
12#define find_first_bit(addr, size) find_next_bit((addr), (size), 0) 35#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
13#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) 36#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
14 37
38#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
39
15#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */ 40#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index fc68053378ce..adb0f113f571 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -136,28 +136,6 @@ static inline unsigned long __ffs64(u64 word)
136} 136}
137 137
138#ifdef __KERNEL__ 138#ifdef __KERNEL__
139#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
140
141/**
142 * find_first_bit - find the first set bit in a memory region
143 * @addr: The address to start the search at
144 * @size: The maximum size to search
145 *
146 * Returns the bit number of the first set bit.
147 */
148extern unsigned long find_first_bit(const unsigned long *addr,
149 unsigned long size);
150
151/**
152 * find_first_zero_bit - find the first cleared bit in a memory region
153 * @addr: The address to start the search at
154 * @size: The maximum size to search
155 *
156 * Returns the bit number of the first cleared bit.
157 */
158extern unsigned long find_first_zero_bit(const unsigned long *addr,
159 unsigned long size);
160#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
161 139
162#ifdef CONFIG_GENERIC_FIND_LAST_BIT 140#ifdef CONFIG_GENERIC_FIND_LAST_BIT
163/** 141/**