qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [RFC PATCH] utils: Add up_pow_of_two()
Date: Mon, 23 Feb 2015 23:20:13 +1100	[thread overview]
Message-ID: <54EB1AFD.2060809@ozlabs.ru> (raw)
In-Reply-To: <CAFEAcA-Z2kv_K1V1K9pRom6s2ui=hVx+uzOVbqN2aZd4zUQp9Q@mail.gmail.com>

On 02/23/2015 07:54 PM, Peter Maydell wrote:
> On 23 February 2015 at 16:49, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>> This adds a helper to get closest bigger power-of-two value.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>
>> 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	other threads:[~2015-02-23 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23  7:49 [Qemu-devel] [RFC PATCH] utils: Add up_pow_of_two() Alexey Kardashevskiy
2015-02-23  8:54 ` Peter Maydell
2015-02-23 12:20   ` Alexey Kardashevskiy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EB1AFD.2060809@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).