The second format string argument, GRUB_EFI_MAX_USABLE_ADDRESS, is a macro
to a number literal. However depending on what the target architecture, the
type can be 32 or 64 bits. Cast to a 64-bit integer.  Also, change the
format string literals %llx to use PRIxGRUB_UINT64_T.

Signed-off-by: Glenn Washburn <developm...@efficientek.com>
---
 grub-core/kern/efi/mm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 8d380c054..0cdb063bb 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -127,8 +127,9 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t 
address,
   if (address > GRUB_EFI_MAX_USABLE_ADDRESS)
     {
       grub_error (GRUB_ERR_BAD_ARGUMENT,
-                 N_("invalid memory address (0x%llx > 0x%llx)"),
-                 address, GRUB_EFI_MAX_USABLE_ADDRESS);
+                 N_("invalid memory address (0x%" PRIxGRUB_UINT64_T
+                     " > 0x%" PRIxGRUB_UINT64_T ")"),
+                 address, (grub_efi_uint64_t) GRUB_EFI_MAX_USABLE_ADDRESS);
       return NULL;
     }
 
-- 
2.27.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to