qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL v4 09/29] pci/shpc: Move function to generic head


From: Eric Blake
Subject: Re: [Qemu-devel] [PULL v4 09/29] pci/shpc: Move function to generic header file
Date: Thu, 18 Jan 2018 15:51:17 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 01/18/2018 02:44 PM, Michael S. Tsirkin wrote:
> From: Yuval Shaia <address@hidden>
> 
> This function should be declared in generic header file so we can
> utilize it.
> 
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> Signed-off-by: Yuval Shaia <address@hidden>
> Signed-off-by: Marcel Apfelbaum <address@hidden>
> Reviewed-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
>  include/qemu/host-utils.h | 10 ++++++++++
>  hw/pci/shpc.c             | 13 ++-----------
>  2 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
> index 5ac621c..38da849 100644
> --- a/include/qemu/host-utils.h
> +++ b/include/qemu/host-utils.h
> @@ -400,6 +400,16 @@ static inline uint64_t pow2ceil(uint64_t value)
>      return 0x8000000000000000ull >> (n - 1);
>  }
>  
> +static inline uint32_t pow2roundup32(uint32_t x)
> +{
> +    x |= (x >> 1);
> +    x |= (x >> 2);
> +    x |= (x >> 4);
> +    x |= (x >> 8);
> +    x |= (x >> 16);
> +    return x + 1;
> +}

How does this differ from pow2ceil(), other than the difference in type?

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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