aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/bitops
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-05-26 19:26:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 20:12:38 -0400
commit19de85ef574c3a2182e3ccad9581805052f14946 (patch)
tree98212bc122ac55807e562fd1ae6d0c5f0f2564d0 /include/asm-generic/bitops
parenta2812e178321132811a53f7be40fe7e9bbffd9e0 (diff)
bitops: add #ifndef for each of find bitops
The style that we normally use in asm-generic is to test the macro itself for existence, so in asm-generic, do: #ifndef find_next_zero_bit_le extern unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset); #endif and in the architectures, write static inline unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) #define find_next_zero_bit_le find_next_zero_bit_le This adds the #ifndef for each of the find bitops in the generic header and source files. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/bitops')
-rw-r--r--include/asm-generic/bitops/find.h4
-rw-r--r--include/asm-generic/bitops/le.h7
2 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
index 110fa700f853..71c778033f57 100644
--- a/include/asm-generic/bitops/find.h
+++ b/include/asm-generic/bitops/find.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_GENERIC_BITOPS_FIND_H_ 1#ifndef _ASM_GENERIC_BITOPS_FIND_H_
2#define _ASM_GENERIC_BITOPS_FIND_H_ 2#define _ASM_GENERIC_BITOPS_FIND_H_
3 3
4#ifndef find_next_bit
4/** 5/**
5 * find_next_bit - find the next set bit in a memory region 6 * find_next_bit - find the next set bit in a memory region
6 * @addr: The address to base the search on 7 * @addr: The address to base the search on
@@ -9,7 +10,9 @@
9 */ 10 */
10extern unsigned long find_next_bit(const unsigned long *addr, unsigned long 11extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
11 size, unsigned long offset); 12 size, unsigned long offset);
13#endif
12 14
15#ifndef find_next_zero_bit
13/** 16/**
14 * find_next_zero_bit - find the next cleared bit in a memory region 17 * find_next_zero_bit - find the next cleared bit in a memory region
15 * @addr: The address to base the search on 18 * @addr: The address to base the search on
@@ -18,6 +21,7 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
18 */ 21 */
19extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned 22extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
20 long size, unsigned long offset); 23 long size, unsigned long offset);
24#endif
21 25
22#ifdef CONFIG_GENERIC_FIND_FIRST_BIT 26#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
23 27
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 946a21b1b5dc..f95c663a6a41 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -30,13 +30,20 @@ static inline unsigned long find_first_zero_bit_le(const void *addr,
30 30
31#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) 31#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
32 32
33#ifndef find_next_zero_bit_le
33extern unsigned long find_next_zero_bit_le(const void *addr, 34extern unsigned long find_next_zero_bit_le(const void *addr,
34 unsigned long size, unsigned long offset); 35 unsigned long size, unsigned long offset);
36#endif
37
38#ifndef find_next_bit_le
35extern unsigned long find_next_bit_le(const void *addr, 39extern unsigned long find_next_bit_le(const void *addr,
36 unsigned long size, unsigned long offset); 40 unsigned long size, unsigned long offset);
41#endif
37 42
43#ifndef find_first_zero_bit_le
38#define find_first_zero_bit_le(addr, size) \ 44#define find_first_zero_bit_le(addr, size) \
39 find_next_zero_bit_le((addr), (size), 0) 45 find_next_zero_bit_le((addr), (size), 0)
46#endif
40 47
41#else 48#else
42#error "Please fix <asm/byteorder.h>" 49#error "Please fix <asm/byteorder.h>"