Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bitops/find: clarify and extend documentation

Add return value documentation and clarify the units of the @size
parameter.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Cody P Schafer and committed by
Linus Torvalds
ec778edf c962f7b9

+10 -2
+10 -2
include/asm-generic/bitops/find.h
··· 7 7 * @addr: The address to base the search on 8 8 * @offset: The bitnumber to start searching at 9 9 * @size: The bitmap size in bits 10 + * 11 + * Returns the bit number for the next set bit 12 + * If no bits are set, returns @size. 10 13 */ 11 14 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long 12 15 size, unsigned long offset); ··· 21 18 * @addr: The address to base the search on 22 19 * @offset: The bitnumber to start searching at 23 20 * @size: The bitmap size in bits 21 + * 22 + * Returns the bit number of the next zero bit 23 + * If no bits are zero, returns @size. 24 24 */ 25 25 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned 26 26 long size, unsigned long offset); ··· 34 28 /** 35 29 * find_first_bit - find the first set bit in a memory region 36 30 * @addr: The address to start the search at 37 - * @size: The maximum size to search 31 + * @size: The maximum number of bits to search 38 32 * 39 33 * Returns the bit number of the first set bit. 34 + * If no bits are set, returns @size. 40 35 */ 41 36 extern unsigned long find_first_bit(const unsigned long *addr, 42 37 unsigned long size); ··· 45 38 /** 46 39 * find_first_zero_bit - find the first cleared bit in a memory region 47 40 * @addr: The address to start the search at 48 - * @size: The maximum size to search 41 + * @size: The maximum number of bits to search 49 42 * 50 43 * Returns the bit number of the first cleared bit. 44 + * If no bits are zero, returns @size. 51 45 */ 52 46 extern unsigned long find_first_zero_bit(const unsigned long *addr, 53 47 unsigned long size);