grub-devel
[Top][All Lists]
Advanced

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

[PATCH v2 1/5] Use the correct format specifier for formatted output


From: Xiaotian Wu
Subject: [PATCH v2 1/5] Use the correct format specifier for formatted output
Date: Wed, 7 Jun 2023 15:34:53 +0800

Use "PRIxGRUB_INT64_T" format specifier for "grub_int64_t" type, and drop the
casts code.

Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
---
 grub-core/kern/arm64/dl_helper.c       | 4 ++--
 grub-core/kern/loongarch64/dl_helper.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/grub-core/kern/arm64/dl_helper.c b/grub-core/kern/arm64/dl_helper.c
index cf7d432a3..10e3d1ec2 100644
--- a/grub-core/kern/arm64/dl_helper.c
+++ b/grub-core/kern/arm64/dl_helper.c
@@ -46,9 +46,9 @@ grub_arm64_set_xxxx26_offset (grub_uint32_t *place, 
grub_int64_t offset)
 {
   const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfc000000);
 
-  grub_dprintf ("dl", "  reloc_xxxx64 %p %c= 0x%llx\n",
+  grub_dprintf ("dl", "  reloc_xxxx64 %p %c= 0x%" PRIxGRUB_INT64_T "\n",
                place, offset > 0 ? '+' : '-',
-               offset < 0 ? (long long) -(unsigned long long) offset : offset);
+               offset < 0 ? -offset : offset);
 
   *place &= insmask;
   *place |= grub_cpu_to_le32 (offset >> 2) & ~insmask;
diff --git a/grub-core/kern/loongarch64/dl_helper.c 
b/grub-core/kern/loongarch64/dl_helper.c
index cda1a53c8..e869ce9ac 100644
--- a/grub-core/kern/loongarch64/dl_helper.c
+++ b/grub-core/kern/loongarch64/dl_helper.c
@@ -205,9 +205,9 @@ void grub_loongarch64_b26 (grub_uint32_t *place, 
grub_int64_t offset)
   grub_uint32_t val;
   const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfc000000);
 
-  grub_dprintf ("dl", "  reloc_xxxx64 %p %c= 0x%llx\n",
+  grub_dprintf ("dl", "  reloc_b26 %p %c= 0x%" PRIxGRUB_INT64_T "\n",
                place, offset > 0 ? '+' : '-',
-               offset < 0 ? (long long) -(unsigned long long) offset : offset);
+               offset < 0 ? -offset : offset);
 
   val = ((offset >> 18) & 0x3ff) | (((offset >> 2) & 0xffff) << 10);
 
-- 
2.20.1




reply via email to

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