Skip to content

Commit

Permalink
Correct string specifiers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
jlintonarm authored and horms committed Dec 13, 2024
1 parent 6aecc32 commit aecc554
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions kexec/arch/arm64/crashdump-arm64.c
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/i386/crashdump-x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/i386/kexec-x86-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/i386/x86-linux-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions util_lib/elf_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit aecc554

Please sign in to comment.