Skip to content

Commit ec778ed

Browse files
codypstorvalds
authored andcommitted
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>
1 parent c962f7b commit ec778ed

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • include/asm-generic/bitops

‎include/asm-generic/bitops/find.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* @addr: The address to base the search on
88
* @offset: The bitnumber to start searching at
99
* @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.
1013
*/
1114
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
1215
size, unsigned long offset);
@@ -18,6 +21,9 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
1821
* @addr: The address to base the search on
1922
* @offset: The bitnumber to start searching at
2023
* @size: The bitmap size in bits
24+
*
25+
* Returns the bit number of the next zero bit
26+
* If no bits are zero, returns @size.
2127
*/
2228
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
2329
long size, unsigned long offset);
@@ -28,19 +34,21 @@ extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
2834
/**
2935
* find_first_bit - find the first set bit in a memory region
3036
* @addr: The address to start the search at
31-
* @size: The maximum size to search
37+
* @size: The maximum number of bits to search
3238
*
3339
* Returns the bit number of the first set bit.
40+
* If no bits are set, returns @size.
3441
*/
3542
extern unsigned long find_first_bit(const unsigned long *addr,
3643
unsigned long size);
3744

3845
/**
3946
* find_first_zero_bit - find the first cleared bit in a memory region
4047
* @addr: The address to start the search at
41-
* @size: The maximum size to search
48+
* @size: The maximum number of bits to search
4249
*
4350
* Returns the bit number of the first cleared bit.
51+
* If no bits are zero, returns @size.
4452
*/
4553
extern unsigned long find_first_zero_bit(const unsigned long *addr,
4654
unsigned long size);

0 commit comments

Comments
 (0)