From 5c769ab711b8a25150ecf8d612f69d1cae63c2ee Mon Sep 17 00:00:00 2001 From: Mate Kukri Date: Sun, 17 Mar 2024 18:26:28 +0000 Subject: [PATCH] util/intelmetool: Print the address in `map_physical` errors in hex Previously the incorrect 'd' format specifier was used despite the '0x' prefix implying hex to the user. Change-Id: Ib97bd86ee0e0c8fe8c3785e22a4d9f6def3cae61 Signed-off-by: Mate Kukri Reviewed-on: https://review.coreboot.org/c/coreboot/+/81191 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- util/intelmetool/mmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/intelmetool/mmap.c b/util/intelmetool/mmap.c index 6200dcbc51..988085ecd3 100644 --- a/util/intelmetool/mmap.c +++ b/util/intelmetool/mmap.c @@ -18,8 +18,8 @@ void *map_physical_exact(off_t phys_addr, void *mapto, size_t len) if (virt_addr == MAP_FAILED) { err = errno; - printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d %s\n", - (intmax_t)phys_addr, len, err, strerror(err)); + printf("Error mapping physical memory 0x%016jx [0x%zx] ERRNO=%d %s\n", + (uintmax_t)phys_addr, len, err, strerror(err)); return NULL; } @@ -35,8 +35,8 @@ void *map_physical(off_t phys_addr, size_t len) if (virt_addr == MAP_FAILED) { err = errno; - printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d %s\n", - (intmax_t)phys_addr, len, err, strerror(err)); + printf("Error mapping physical memory 0x%016jx [0x%zx] ERRNO=%d %s\n", + (uintmax_t)phys_addr, len, err, strerror(err)); return NULL; }