qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] utils: Add up_pow_of_two()


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH] utils: Add up_pow_of_two()
Date: Mon, 23 Feb 2015 17:54:28 +0900

On 23 February 2015 at 16:49, Alexey Kardashevskiy <address@hidden> wrote:
> This adds a helper to get closest bigger power-of-two value.
>
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> ---
>
> It is a log2 of round up to power of two. Is there anything like this
> in QEMU already? Any better name than up_pow_of_two()?

Maybe separate out the "round up to power of 2" and "log2" parts
into separate functions? If you do that then you could call the
first one of those pow2ceil(), to match our existing
pow2floor().

-- PMM



reply via email to

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