kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Correct string specifiers
@ 2024-12-11  2:58 Jeremy Linton
  2024-12-13 12:43 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Linton @ 2024-12-11  2:58 UTC (permalink / raw)
  To: kexec; +Cc: piliu, horms, Jeremy Linton

Recent GCC's on fedora complain about the use of
%lld for uint64_t because its unsigned. Convert a number
of these and similar calls.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
---
 kexec/arch/arm64/crashdump-arm64.c | 4 ++--
 kexec/arch/i386/crashdump-x86.c    | 2 +-
 kexec/arch/i386/kexec-x86-common.c | 2 +-
 kexec/arch/i386/x86-linux-setup.c  | 2 +-
 util_lib/elf_info.c                | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
index f23b2bf..73cb611 100644
--- a/kexec/arch/arm64/crashdump-arm64.c
+++ b/kexec/arch/arm64/crashdump-arm64.c
@@ -1,6 +1,6 @@
 /*
  * ARM64 crashdump.
- *     partly derived from arm implementation
+ *     partly derived from                                    arm implementation
  *
  * Copyright (c) 2014-2017 Linaro Limited
  * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
@@ -71,7 +71,7 @@ static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
 		 */
 		for (i = 0; i < usablemem_rgns.max_size; i++) {
 			if (usablemem_rgns.ranges[i].start == base) {
-				fprintf(stderr, "Warning, the range already exists in usablemem_rgns, base=%lx, length=%lx\n",
+				fprintf(stderr, "Warning, the range already exists in usablemem_rgns, base=%llx, length=%llx\n",
 						base, length);
 				return 0;
 			}
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 800ae2c..770e3f1 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -784,7 +784,7 @@ static void cmdline_add_efi(char *cmdline)
 	if (!acpi_rsdp)
 		return;
 
-	sprintf(acpi_rsdp_buf, " acpi_rsdp=0x%llx", acpi_rsdp);
+	sprintf(acpi_rsdp_buf, " acpi_rsdp=0x%lux", acpi_rsdp);
 	if (strlen(cmdline) + strlen(acpi_rsdp_buf) > (COMMAND_LINE_SIZE - 1))
 		die("Command line overflow\n");
 
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index 67da043..acacb45 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -422,7 +422,7 @@ static uint64_t efi_get_acpi_rsdp(void) {
 		/* ACPI20= always goes before ACPI= */
 		if ((strstr(line, "ACPI20=")) || (strstr(line, "ACPI="))) {
 			s = strchr(line, '=') + 1;
-			sscanf(s, "0x%llx", &acpi_rsdp);
+			sscanf(s, "0x%lux", &acpi_rsdp);
 			break;
 		}
 	}
diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c
index 1f96372..70656e3 100644
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -760,7 +760,7 @@ static void add_e820_map_from_mr(struct x86_linux_param_header *real_mode,
 				e820[i].type = E820_RESERVED;
 				break;
 		}
-		dbgprintf("%016llx-%016llx (%d)\n",
+		dbgprintf("%016lux-%016lux (%d)\n",
 				e820[i].addr,
 				e820[i].addr + e820[i].size - 1,
 				e820[i].type);
diff --git a/util_lib/elf_info.c b/util_lib/elf_info.c
index 8f84f52..5cf438c 100644
--- a/util_lib/elf_info.c
+++ b/util_lib/elf_info.c
@@ -890,7 +890,7 @@ static void dump_dmesg_structured(int fd, void (*handler)(char*, unsigned int))
 					handler(out_buf, len);
 				fprintf(stderr, "Cycle when parsing dmesg detected.\n");
 				fprintf(stderr, "The prink log_buf is most likely corrupted.\n");
-				fprintf(stderr, "log_buf = 0x%llx, idx = 0x%x\n",
+				fprintf(stderr, "log_buf = 0x%lux, idx = 0x%x\n",
 					log_buf, current_idx);
 				exit(68);
 			}
@@ -904,7 +904,7 @@ static void dump_dmesg_structured(int fd, void (*handler)(char*, unsigned int))
 					handler(out_buf, len);
 				fprintf(stderr, "Index outside log_buf detected.\n");
 				fprintf(stderr, "The prink log_buf is most likely corrupted.\n");
-				fprintf(stderr, "log_buf = 0x%llx, idx = 0x%x\n",
+				fprintf(stderr, "log_buf = 0x%lux, idx = 0x%x\n",
 					log_buf, current_idx);
 				exit(69);
 			}
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Correct string specifiers
  2024-12-11  2:58 [PATCH] Correct string specifiers Jeremy Linton
@ 2024-12-13 12:43 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-12-13 12:43 UTC (permalink / raw)
  To: Jeremy Linton; +Cc: kexec, piliu

On Tue, Dec 10, 2024 at 08:58:46PM -0600, Jeremy Linton wrote:
> Recent GCC's on fedora complain about the use of
> %lld for uint64_t because its unsigned. Convert a number
> of these and similar calls.
> 
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

Thanks, applied.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-13 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11  2:58 [PATCH] Correct string specifiers Jeremy Linton
2024-12-13 12:43 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).