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
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to