grub-devel
[Top][All Lists]
Advanced

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

[PATCH v1 05/15] efi/api: Add PRIxGRUB_EFI_STATUS and use it.


From: Leo Sandoval
Subject: [PATCH v1 05/15] efi/api: Add PRIxGRUB_EFI_STATUS and use it.
Date: Thu, 31 Oct 2024 13:42:48 -0600

From: Peter Jones <pjones@redhat.com>

This avoids syntax checkers getting confused about if it's llx or lx.

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 include/grub/efi/api.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index d44d00ad7..5f3cd4cc0 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -577,7 +577,16 @@ typedef grub_uint64_t grub_efi_uint64_t;
 typedef grub_uint8_t grub_efi_char8_t;
 typedef grub_uint16_t grub_efi_char16_t;
 
+
 typedef grub_efi_uintn_t grub_efi_status_t;
+/* Make grub_efi_status_t reasonably printable. */
+#if GRUB_CPU_SIZEOF_VOID_P == 8
+#define PRIxGRUB_EFI_STATUS "lx"
+#define PRIdGRUB_EFI_STATUS "ld"
+#else
+#define PRIxGRUB_EFI_STATUS "llx"
+#define PRIdGRUB_EFI_STATUS "lld"
+#endif
 
 /*
  * On x86, the EFI calling convention may deviate from the local one, so
-- 
2.46.2




reply via email to

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