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: Alexey Kardashevskiy
Subject: Re: [Qemu-devel] [RFC PATCH] utils: Add up_pow_of_two()
Date: Mon, 23 Feb 2015 23:20:13 +1100
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/23/2015 07:54 PM, Peter Maydell wrote:
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().


good point, powe2ceil() is enough for me, I'll repost it in a sec. thanks!


--
Alexey



reply via email to

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