From: xypron.glpk@gmx.de Date: Fri, 11 Aug 2017 19:19:37 +0000 (+0200) Subject: efi_loader: use EFI_PAGE_MASK instead of EFI_PAGE_SIZE - 1 X-Git-Tag: v2025.01-rc5-pxa1908~6004^2~2 X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=aee4f06dff36261433d90c94a5def2c90be8407c;p=u-boot.git efi_loader: use EFI_PAGE_MASK instead of EFI_PAGE_SIZE - 1 We should be consistent in the way we calculate page sizes. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index dd52755d1d..ad7f3754bd 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -325,7 +325,7 @@ void efi_add_runtime_mmio(void *mmio_ptr, u64 len) { struct efi_runtime_mmio_list *newmmio; - u64 pages = (len + EFI_PAGE_SIZE - 1) >> EFI_PAGE_SHIFT; + u64 pages = (len + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; efi_add_memory_map(*(uintptr_t *)mmio_ptr, pages, EFI_MMAP_IO, false); newmmio = calloc(1, sizeof(*newmmio));