Skip to content

Commit d852a6a

Browse files
mitaarndb
authored andcommitted
bitops: remove duplicated extern declarations
If CONFIG_GENERIC_FIND_NEXT_BIT is enabled, find_next_bit() and find_next_zero_bit() are doubly declared in asm-generic/bitops/find.h and linux/bitops.h. asm/bitops.h includes asm-generic/bitops/find.h if and only if the architecture enables CONFIG_GENERIC_FIND_NEXT_BIT. And asm/bitops.h is included by linux/bitops.h So we can just remove the extern declarations of find_next_bit() and find_next_zero_bit() in linux/bitops.h. Also we can remove unneeded #ifndef CONFIG_GENERIC_FIND_NEXT_BIT in asm-generic/bitops/find.h. Signed-off-by: Akinobu Mita <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 708ff2a commit d852a6a

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

include/asm-generic/bitops/find.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
#ifndef _ASM_GENERIC_BITOPS_FIND_H_
22
#define _ASM_GENERIC_BITOPS_FIND_H_
33

4-
#ifndef CONFIG_GENERIC_FIND_NEXT_BIT
4+
/**
5+
* find_next_bit - find the next set bit in a memory region
6+
* @addr: The address to base the search on
7+
* @offset: The bitnumber to start searching at
8+
* @size: The bitmap size in bits
9+
*/
510
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
611
size, unsigned long offset);
712

13+
/**
14+
* find_next_zero_bit - find the next cleared bit in a memory region
15+
* @addr: The address to base the search on
16+
* @offset: The bitnumber to start searching at
17+
* @size: The bitmap size in bits
18+
*/
819
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
920
long size, unsigned long offset);
10-
#endif
1121

1222
#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
1323

include/linux/bitops.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -149,28 +149,5 @@ extern unsigned long find_last_bit(const unsigned long *addr,
149149
unsigned long size);
150150
#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
151151

152-
#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
153-
154-
/**
155-
* find_next_bit - find the next set bit in a memory region
156-
* @addr: The address to base the search on
157-
* @offset: The bitnumber to start searching at
158-
* @size: The bitmap size in bits
159-
*/
160-
extern unsigned long find_next_bit(const unsigned long *addr,
161-
unsigned long size, unsigned long offset);
162-
163-
/**
164-
* find_next_zero_bit - find the next cleared bit in a memory region
165-
* @addr: The address to base the search on
166-
* @offset: The bitnumber to start searching at
167-
* @size: The bitmap size in bits
168-
*/
169-
170-
extern unsigned long find_next_zero_bit(const unsigned long *addr,
171-
unsigned long size,
172-
unsigned long offset);
173-
174-
#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */
175152
#endif /* __KERNEL__ */
176153
#endif

0 commit comments

Comments
 (0)