summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-07-11 09:15:57 -0600
committerTom Rini <[email protected]>2025-10-28 12:21:31 -0600
commitba05f1a8d7d8f2d4f7ff244dfc29c1a7b87477d6 (patch)
treedfbf5aa9f09c0a064d190818c2e96ec49a4e04d8 /drivers/mtd
parentbd7bf693de4f6f1c04159a312ad2b69b30dff8c5 (diff)
mtd: spi: sf_dataflash.c: Make use of 'z' for printing size_t
When printing the contents of an size_t variable we need to use z prefix to the format character in order to get the correct format type depending on 32 or 64bit-ness. Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi/sf_dataflash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c
index 438eb3698d5..9094e008f60 100644
--- a/drivers/mtd/spi/sf_dataflash.c
+++ b/drivers/mtd/spi/sf_dataflash.c
@@ -138,11 +138,11 @@ static int spi_dataflash_erase(struct udevice *dev, u32 offset, size_t len)
memset(dataflash->command, 0 , sizeof(dataflash->command));
command = dataflash->command;
- debug("%s: erase addr=0x%x len 0x%x\n", dev->name, offset, len);
+ debug("%s: erase addr=0x%x len 0x%zx\n", dev->name, offset, len);
div_u64_rem(len, spi_flash->page_size, &rem);
if (rem) {
- printf("%s: len(0x%x) isn't the multiple of page size(0x%x)\n",
+ printf("%s: len(0x%zx) isn't the multiple of page size(0x%x)\n",
dev->name, len, spi_flash->page_size);
return -EINVAL;
}
@@ -229,7 +229,7 @@ static int spi_dataflash_read(struct udevice *dev, u32 offset, size_t len,
memset(dataflash->command, 0 , sizeof(dataflash->command));
command = dataflash->command;
- debug("%s: erase addr=0x%x len 0x%x\n", dev->name, offset, len);
+ debug("%s: erase addr=0x%x len 0x%zx\n", dev->name, offset, len);
debug("READ: (%x) %x %x %x\n",
command[0], command[1], command[2], command[3]);
@@ -287,7 +287,7 @@ int spi_dataflash_write(struct udevice *dev, u32 offset, size_t len,
memset(dataflash->command, 0 , sizeof(dataflash->command));
command = dataflash->command;
- debug("%s: write 0x%x..0x%x\n", dev->name, offset, (offset + len));
+ debug("%s: write 0x%x..0x%zx\n", dev->name, offset, (offset + len));
pageaddr = ((unsigned)offset / spi_flash->page_size);
to = ((unsigned)offset % spi_flash->page_size);