mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: fix format specifier in debug message
@ 2024-01-31 23:03 Ahmad Fatoum
  2024-02-01 15:09 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-01-31 23:03 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The type size_t is to be printed with the %zu modifier as it's not
necessarily typedef'ed as unsigned long, even if for barebox purposes,
the sizeof(size_t) is always equal to sizeof(ulong).

Building the dw-ospi-nor driver for 32-bit warns about this, so fix
that.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mtd/spi-nor/dw-ospi-nor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/dw-ospi-nor.c b/drivers/mtd/spi-nor/dw-ospi-nor.c
index 692c6f9b9dae..897f4f49a9f9 100644
--- a/drivers/mtd/spi-nor/dw-ospi-nor.c
+++ b/drivers/mtd/spi-nor/dw-ospi-nor.c
@@ -637,7 +637,7 @@ static void dw_spi_write(struct spi_nor *nor, loff_t to,
 	struct dw_spi_nor *dw_spi = nor->priv;
 
 	*retlen = 0;
-	dev_dbg(dw_spi->dev, "write %ld bytes at @0x%llx\n", len, to);
+	dev_dbg(dw_spi->dev, "write %zu bytes at @0x%llx\n", len, to);
 
 	if (dw_spi_is_enhanced(nor->write_proto)) {
 		if (dw_spi_prep_enhanced(nor, nor->write_proto, SPI_TMOD_TO))
@@ -673,7 +673,7 @@ static int dw_spi_read(struct spi_nor *nor, loff_t from,
 	size_t chunk;
 
 	*retlen = 0;
-	dev_dbg(nor->dev, "read %ld bytes from @0x%llx\n", len, from);
+	dev_dbg(nor->dev, "read %zu bytes from @0x%llx\n", len, from);
 
 	if (enhanced)
 		ret = dw_spi_prep_enhanced(nor, nor->read_proto, SPI_TMOD_RO);
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: spi-nor: fix format specifier in debug message
  2024-01-31 23:03 [PATCH] mtd: spi-nor: fix format specifier in debug message Ahmad Fatoum
@ 2024-02-01 15:09 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-02-01 15:09 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Thu, 01 Feb 2024 00:03:47 +0100, Ahmad Fatoum wrote:
> The type size_t is to be printed with the %zu modifier as it's not
> necessarily typedef'ed as unsigned long, even if for barebox purposes,
> the sizeof(size_t) is always equal to sizeof(ulong).
> 
> Building the dw-ospi-nor driver for 32-bit warns about this, so fix
> that.
> 
> [...]

Applied, thanks!

[1/1] mtd: spi-nor: fix format specifier in debug message
      https://git.pengutronix.de/cgit/barebox/commit/?id=eca34ec9b611 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-01 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 23:03 [PATCH] mtd: spi-nor: fix format specifier in debug message Ahmad Fatoum
2024-02-01 15:09 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox