[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/8] bitops.h: Improve find_xxx_bit() documentation
From: |
Stefan Hajnoczi |
Subject: |
[PULL 2/8] bitops.h: Improve find_xxx_bit() documentation |
Date: |
Mon, 24 May 2021 14:01:44 +0100 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Document the following functions return the bitmap size
if no matching bit is found:
- find_first_bit
- find_next_bit
- find_last_bit
- find_first_zero_bit
- find_next_zero_bit
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20210510200758.2623154-2-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
include/qemu/bitops.h | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 3acbf3384c..a72f69fea8 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -140,7 +140,8 @@ static inline int test_bit(long nr, const unsigned long
*addr)
* @addr: The address to start the search at
* @size: The maximum size to search
*
- * Returns the bit number of the first set bit, or size.
+ * Returns the bit number of the last set bit,
+ * or @size if there is no set bit in the bitmap.
*/
unsigned long find_last_bit(const unsigned long *addr,
unsigned long size);
@@ -150,6 +151,9 @@ unsigned long find_last_bit(const unsigned long *addr,
* @addr: The address to base the search on
* @offset: The bitnumber to start searching at
* @size: The bitmap size in bits
+ *
+ * Returns the bit number of the next set bit,
+ * or @size if there are no further set bits in the bitmap.
*/
unsigned long find_next_bit(const unsigned long *addr,
unsigned long size,
@@ -160,6 +164,9 @@ unsigned long find_next_bit(const unsigned long *addr,
* @addr: The address to base the search on
* @offset: The bitnumber to start searching at
* @size: The bitmap size in bits
+ *
+ * Returns the bit number of the next cleared bit,
+ * or @size if there are no further clear bits in the bitmap.
*/
unsigned long find_next_zero_bit(const unsigned long *addr,
@@ -171,7 +178,8 @@ unsigned long find_next_zero_bit(const unsigned long *addr,
* @addr: The address to start the search at
* @size: The maximum size to search
*
- * Returns the bit number of the first set bit.
+ * Returns the bit number of the first set bit,
+ * or @size if there is no set bit in the bitmap.
*/
static inline unsigned long find_first_bit(const unsigned long *addr,
unsigned long size)
@@ -194,7 +202,8 @@ static inline unsigned long find_first_bit(const unsigned
long *addr,
* @addr: The address to start the search at
* @size: The maximum size to search
*
- * Returns the bit number of the first cleared bit.
+ * Returns the bit number of the first cleared bit,
+ * or @size if there is no clear bit in the bitmap.
*/
static inline unsigned long find_first_zero_bit(const unsigned long *addr,
unsigned long size)
--
2.31.1
- [PULL 0/8] Block patches, Stefan Hajnoczi, 2021/05/24
- [PULL 1/8] multi-process: Initialize variables declared with g_auto*, Stefan Hajnoczi, 2021/05/24
- [PULL 3/8] coroutine-sleep: use a stack-allocated timer, Stefan Hajnoczi, 2021/05/24
- [PULL 4/8] coroutine-sleep: disallow NULL QemuCoSleepState** argument, Stefan Hajnoczi, 2021/05/24
- [PULL 2/8] bitops.h: Improve find_xxx_bit() documentation,
Stefan Hajnoczi <=
- [PULL 5/8] coroutine-sleep: allow qemu_co_sleep_wake that wakes nothing, Stefan Hajnoczi, 2021/05/24
- [PULL 6/8] coroutine-sleep: move timer out of QemuCoSleepState, Stefan Hajnoczi, 2021/05/24
- [PULL 7/8] coroutine-sleep: replace QemuCoSleepState pointer with struct in the API, Stefan Hajnoczi, 2021/05/24
- [PULL 8/8] coroutine-sleep: introduce qemu_co_sleep, Stefan Hajnoczi, 2021/05/24
- Re: [PULL 0/8] Block patches, Peter Maydell, 2021/05/24