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 <trini@konsulko.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user