grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] grub-core/kern/efi/mm.c fix warning message


From: Jeremy Szu
Subject: [PATCH 1/3] grub-core/kern/efi/mm.c fix warning message
Date: Tue, 6 Dec 2022 15:35:19 +0800

From: Jeremy Su <os369510@gmail.com>

When enable print_memory_map() for debugging, the warning message
presents because of the types. Fix it by adding the macros in
include/grub/efi/api.h.
---
 grub-core/kern/efi/mm.c | 5 ++++-
 include/grub/efi/api.h  | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 3705b8b1b..5362247bc 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -558,7 +558,10 @@ print_memory_map (grub_efi_memory_descriptor_t *memory_map,
        desc < memory_map_end;
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size), i++)
     {
-      grub_printf ("MD: t=%x, p=%llx, v=%llx, n=%llx, a=%llx\n",
+      grub_printf ("MD: t=%x, p=%" PRIxGRUB_EFI_UINT64_T \
+                  ", v=%" PRIxGRUB_EFI_UINT64_T \
+                  ", n=%" PRIxGRUB_EFI_UINT64_T \
+                  ", a=%" PRIxGRUB_EFI_UINT64_T "\n",
                   desc->type, desc->physical_start, desc->virtual_start,
                   desc->num_pages, desc->attribute);
     }
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index b1a7259b9..84d5146a5 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -569,6 +569,8 @@ typedef grub_uint32_t grub_efi_uint32_t;
 #define PRIuGRUB_EFI_UINT32_T  PRIuGRUB_UINT32_T
 typedef grub_int64_t grub_efi_int64_t;
 typedef grub_uint64_t grub_efi_uint64_t;
+#define PRIxGRUB_EFI_UINT64_T  PRIxGRUB_UINT64_T
+#define PRIuGRUB_EFI_UINT64_T  PRIuGRUB_UINT64_T
 typedef grub_uint8_t grub_efi_char8_t;
 typedef grub_uint16_t grub_efi_char16_t;
 
-- 
2.38.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]