[PATCH 1/1] efi_loader: use EFI_PAGE_MASK instead of EFI_PAGE_SIZE - 1

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 1/1] efi_loader: use EFI_PAGE_MASK instead of EFI_PAGE_SIZE - 1

Heinrich Schuchardt
We should be consistent in the way we calculate page sizes.

Signed-off-by: Heinrich Schuchardt <[hidden email]>
---
 lib/efi_loader/efi_runtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
--
2.11.0

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Loading...