At least gcc 3.0 doesn't do the optimization for you, unfortunately 8(
So I agree, although I'd prefer the stricter definition.
Rusty.
PS. Previous documentation was written by a bad monkey, so I've fixed
it to actually say something useful, too.
-- Anyone who quotes me in their sig is an idiot. -- Rusty Russell.diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5-bk/include/asm-i386/bitops.h working-2.5-bk-find_first_bit/include/asm-i386/bitops.h --- linux-2.5-bk/include/asm-i386/bitops.h 2002-11-09 13:33:20.000000000 +1100 +++ working-2.5-bk-find_first_bit/include/asm-i386/bitops.h 2002-11-09 14:12:32.000000000 +1100 @@ -263,10 +263,10 @@ static __inline__ int variable_test_bit( /** * find_first_zero_bit - find the first zero bit in a memory region * @addr: The address to start the search at - * @size: The maximum size to search + * @size: The maximum size to search (may be rounded up by BITS_PER_LONG) * - * Returns the bit-number of the first zero bit, not the number of the byte - * containing a bit. + * Returns the bit-number of the first zero bit (not the number of the byte + * containing the bit) or a value >= size if none found. */ static __inline__ int find_first_zero_bit(unsigned long * addr, unsigned size) { @@ -295,10 +295,10 @@ static __inline__ int find_first_zero_bi /** * 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 + * @size: The maximum size to search (may be rounded up by BITS_PER_LONG) * - * Returns the bit-number of the first set bit, not the number of the byte - * containing a bit. + * Returns the bit-number of the first set bit (not the number of the byte + * containing the bit) or a value >= size if none found. */ static __inline__ int find_first_bit(unsigned long * addr, unsigned size) { @@ -321,10 +321,14 @@ static __inline__ int find_first_bit(uns } /** - * find_next_zero_bit - find the first zero bit in a memory region + * find_next_zero_bit - find the next zero bit in a memory region * @addr: The address to base the search on * @offset: The bitnumber to start searching at - * @size: The maximum size to search + * @size: The maximum size to search (may be rounded up by BITS_PER_LONG) + * + * Returns the bit-number of the first zero bit >= offset (not the + * number of the byte containing the bit), or a value >= size if none + * found. */ static __inline__ int find_next_zero_bit(unsigned long * addr, int size, int offset) { @@ -354,10 +358,14 @@ static __inline__ int find_next_zero_bit } /** - * find_next_bit - find the first set bit in a memory region + * find_next_bit - find the next set bit in a memory region * @addr: The address to base the search on * @offset: The bitnumber to start searching at - * @size: The maximum size to search + * @size: The maximum size to search (may be rounded up by BITS_PER_LONG) + * + * Returns the bit-number of the first bit set >= offset (not the + * number of the byte containing the bit) or a value >= size if none + * found. */ static __inline__ int find_next_bit(unsigned long *addr, int size, int offset) { - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/