summaryrefslogtreecommitdiffstats
path: root/sfdp.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 /sfdp.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 'sfdp.c')
-rw-r--r--sfdp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sfdp.c b/sfdp.c
index 5eddb2113..868377933 100644
--- a/sfdp.c
+++ b/sfdp.c
@@ -35,7 +35,7 @@ static int spi_sfdp_read_sfdp_chunk(struct flashctx *flash, uint32_t address, ui
*/
0
};
- msg_cspew("%s: addr=0x%x, len=%d, data:\n", __func__, address, len);
+ msg_cspew("%s: addr=0x%"PRIx32", len=%d, data:\n", __func__, address, len);
newbuf = malloc(len + 1);
if (!newbuf)
return SPI_PROGRAMMER_ERROR;
@@ -96,7 +96,7 @@ static int sfdp_add_uniform_eraser(struct flashchip *chip, uint8_t opcode, uint3
if (eraser->eraseblocks[0].size == block_size &&
eraser->block_erase == erasefn) {
msg_cdbg2(" Tried to add a duplicate block eraser: "
- "%d x %d B with opcode 0x%02x.\n",
+ "%"PRId32" x %"PRId32" B with opcode 0x%02x.\n",
total_size/block_size, block_size, opcode);
return 1;
}
@@ -110,7 +110,7 @@ static int sfdp_add_uniform_eraser(struct flashchip *chip, uint8_t opcode, uint3
eraser->block_erase = erasefn;
eraser->eraseblocks[0].size = block_size;
eraser->eraseblocks[0].count = total_size/block_size;
- msg_cdbg2(" Block eraser %d: %d x %d B with opcode "
+ msg_cdbg2(" Block eraser %d: %"PRId32" x %"PRId32" B with opcode "
"0x%02x\n", i, total_size/block_size, block_size,
opcode);
return 0;
@@ -274,7 +274,7 @@ int probe_spi_sfdp(struct flashctx *flash)
tmp32 |= ((unsigned int)buf[3]) << 24;
if (tmp32 != 0x50444653) {
- msg_cdbg2("Signature = 0x%08x (should be 0x50444653)\n", tmp32);
+ msg_cdbg2("Signature = 0x%08"PRIx32" (should be 0x50444653)\n", tmp32);
msg_cdbg("No SFDP signature found.\n");
return 0;
}
@@ -320,7 +320,7 @@ int probe_spi_sfdp(struct flashctx *flash)
hdrs[i].v_major, hdrs[i].v_minor);
len = hdrs[i].len * 4;
tmp32 = hdrs[i].ptp;
- msg_cdbg2(" Length %d B, Parameter Table Pointer 0x%06x\n",
+ msg_cdbg2(" Length %d B, Parameter Table Pointer 0x%06"PRIx32"\n",
len, tmp32);
if (tmp32 + len >= (1 << 24)) {
@@ -345,7 +345,7 @@ int probe_spi_sfdp(struct flashctx *flash)
msg_cspew(" Parameter table contents:\n");
for (tmp32 = 0; tmp32 < len; tmp32++) {
if ((tmp32 % 8) == 0) {
- msg_cspew(" 0x%04x: ", tmp32);
+ msg_cspew(" 0x%04"PRIx32": ", tmp32);
}
msg_cspew(" %02x", tbuf[tmp32]);
if ((tmp32 % 8) == 7) {