aboutsummaryrefslogtreecommitdiffstats
path: root/erasure_layout.c
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2023-02-14 16:50:38 +0100
committerAnastasia Klimchuk <aklm@chromium.org>2023-04-27 09:36:46 +0000
commit90286fe643bbc2493275a5280a26766784435dda (patch)
tree1e9f9923358e35699f21406f545870820b6b8dda /erasure_layout.c
parentba6acffc69b679829bf46f3636b4f6c04bfa7729 (diff)
downloadflashrom-90286fe643bbc2493275a5280a26766784435dda.tar.gz
flashrom-90286fe643bbc2493275a5280a26766784435dda.tar.bz2
flashrom-90286fe643bbc2493275a5280a26766784435dda.zip
printf: Use inttype.h macros for format strings
DJGPP for compiling DOS has other sizes for the normal int types and therefore throwing errors when using %i %d or %x with uint32_t. Fix these warnings by using the macros created for it and provided in inttypes.h. Change-Id: Ia75b6df981ce60c891161fe553c7ceab8570178d Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/73040 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'erasure_layout.c')
-rw-r--r--erasure_layout.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/erasure_layout.c b/erasure_layout.c
index 2097b33b..a802ae48 100644
--- a/erasure_layout.c
+++ b/erasure_layout.c
@@ -313,7 +313,7 @@ int erase_write(struct flashctx *const flashctx, chipoff_t region_start, chipoff
if (region.write_prot) {
msg_gdbg("%s: cannot erase inside %s "
- "region (%#08x..%#08x), skipping range (%#08x..%#08x).\n",
+ "region (%#08"PRIx32"..%#08"PRIx32"), skipping range (%#08x..%#08x).\n",
__func__, region.name,
region.start, region.end - 1,
addr, addr + len - 1);
@@ -321,7 +321,7 @@ int erase_write(struct flashctx *const flashctx, chipoff_t region_start, chipoff
continue;
}
- msg_gdbg("%s: %s region (%#08x..%#08x) is "
+ msg_gdbg("%s: %s region (%#08"PRIx32"..%#08"PRIx32") is "
"writable, erasing range (%#08x..%#08x).\n",
__func__, region.name,
region.start, region.end - 1,
@@ -339,7 +339,7 @@ int erase_write(struct flashctx *const flashctx, chipoff_t region_start, chipoff
ret = erasefn(flashctx, start_addr, block_len);
if (ret) {
msg_cerr("Failed to execute erase command "
- "for offset %#x to %#x.\n",
+ "for offset %#"PRIx32" to %#"PRIx32".\n",
start_addr, start_addr + block_len);
ret = -1;
goto _end;
@@ -349,11 +349,11 @@ int erase_write(struct flashctx *const flashctx, chipoff_t region_start, chipoff
memset(curcontents+start_addr, erased_value, block_len);
// after erase make it unselected again
erase_layout[i].layout_list[j].selected = false;
- msg_cdbg("E(%x:%x)", start_addr, start_addr + block_len - 1);
+ msg_cdbg("E(%"PRIx32":%"PRIx32")", start_addr, start_addr + block_len - 1);
// verify erase
ret = check_erased_range(flashctx, start_addr, block_len);
if (ret) {
- msg_cerr("Verifying flash. Erase failed for range %#x : %#x, Abort.\n",
+ msg_cerr("Verifying flash. Erase failed for range %#"PRIx32" : %#"PRIx32", Abort.\n",
start_addr, start_addr + block_len - 1);
goto _end;
}
@@ -381,14 +381,14 @@ int erase_write(struct flashctx *const flashctx, chipoff_t region_start, chipoff
// adjust curcontents
memcpy(curcontents + region_start + start_here,
newcontents + region_start + start_here, len_here);
- msg_cdbg("W(%x:%x)", region_start + start_here, region_start + start_here + len_here - 1);
+ msg_cdbg("W(%"PRIx32":%"PRIx32")", region_start + start_here, region_start + start_here + len_here - 1);
*all_skipped = false;
}
// verify write
ret = verify_range(flashctx, newcontents + region_start, region_start, region_end - region_start);
if (ret) {
- msg_cerr("Verifying flash. Write failed for range %#x : %#x, Abort.\n",
+ msg_cerr("Verifying flash. Write failed for range %#"PRIx32" : %#"PRIx32", Abort.\n",
region_start, region_end);
goto _end;
}
@@ -400,6 +400,6 @@ _end:
free(old_start_buf);
free(old_end_buf);
- msg_cinfo("Erase/write done from %x to %x\n", region_start, region_end);
+ msg_cinfo("Erase/write done from %"PRIx32" to %"PRIx32"\n", region_start, region_end);
return ret;
}