From: Laszlo Ersek <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: edk2-devel@lists.01.org, Phil Dennis-Jordan <phil@philjordan.eu>
Subject: Re: [PATCH] QemuVideoDxe: round up FrameBufferSize to full page
Date: Wed, 25 Apr 2018 20:08:34 +0200 [thread overview]
Message-ID: <7ca4b23c-92c5-a707-a03b-8b58b175899d@redhat.com> (raw)
In-Reply-To: <92f69b02-b5ab-ed7c-e726-7bdf646494e6@redhat.com>
On 04/25/18 16:08, Laszlo Ersek wrote:
> (1) Please use the EFI_SIZE_TO_PAGES() macro for rounding up the size.
>
> (EFI_SIZE_TO_PAGES() takes one UINTN argument, but there's no need for
> an explicit cast, because
> "EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE.FrameBufferSize" is already UINTN.)
Argh, this request was incomplete. I meant to say:
* Please use EFI_SIZE_TO_PAGES() *with* EFI_PAGES_TO_SIZE() to round up
the value -- this is a pattern we use in edk2 quite a bit, see:
git grep -w -e EFI_PAGES_TO_SIZE --and -e EFI_SIZE_TO_PAGES
(ALIGN_VALUE(), EFI_PAGE_SIZE, EFI_PAGE_MASK etc are also OK to use, but
they generally require casting even the constants to UINTN first --
because those are genuinely "int", i.e. INT32 --, and the casting is
arguably uglier than the above-proposed pattern, where the size that we
start out with is already UINTN.)
Thanks!
Laszlo
prev parent reply other threads:[~2018-04-25 18:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 12:10 [PATCH] QemuVideoDxe: round up FrameBufferSize to full page Gerd Hoffmann
2018-04-25 14:08 ` Laszlo Ersek
2018-04-25 18:08 ` Laszlo Ersek [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-list 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=7ca4b23c-92c5-a707-a03b-8b58b175899d@redhat.com \
--to=devel@edk2.groups.io \
/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