qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] bitops.h: Improve find_xxx_bit() documentation


From: Eric Blake
Subject: Re: [PATCH v2 1/2] bitops.h: Improve find_xxx_bit() documentation
Date: Fri, 7 May 2021 12:38:48 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 5/7/21 12:06 PM, Philippe Mathieu-Daudé wrote:
> Document the following functions return the bitmap size
> if not matching bit is found:

s/not/no/

> 
> - find_first_bit
> - find_next_bit
> - find_last_bit
> - find_first_zero_bit
> - find_next_zero_bit
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  include/qemu/bitops.h | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 

> @@ -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 is no set bit in the bitmap.
>   */
>  unsigned long find_next_bit(const unsigned long *addr,

Misleading - there might be a set bit prior to @offset.  Better might be:

or @size if there are no further set bits in the bitmap.

>                              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 is no clear bit in the bitmap.
>   */
>  
>  unsigned long find_next_zero_bit(const unsigned long *addr,

similarly,

or @size if there are no further clear bits in the bitmap.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]