X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sparc%2Fbitops.h;h=c1009b30e80da1bd3ff3af5a323942f96b00970b;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=a0e09a70ff7882febd06ca90ddbc3889427feda3;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h index a0e09a70f..c1009b30e 100644 --- a/include/asm-sparc/bitops.h +++ b/include/asm-sparc/bitops.h @@ -366,9 +366,9 @@ found_middle: * * Scheduler induced bitop, do not use. */ -static inline int find_next_bit(unsigned long *addr, int size, int offset) +static inline int find_next_bit(const unsigned long *addr, int size, int offset) { - unsigned long *p = addr + (offset >> 5); + const unsigned long *p = addr + (offset >> 5); int num = offset & ~0x1f; unsigned long word; @@ -384,6 +384,17 @@ static inline int find_next_bit(unsigned long *addr, int size, int offset) return num; } +/** + * find_first_bit - find the first 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, not the number of the byte + * containing a bit. + */ +#define find_first_bit(addr, size) \ + find_next_bit((addr), (size), 0) + /* */ static inline int test_le_bit(int nr, __const__ unsigned long * addr)