From f71b44e266aedcaee8b74543f668d695eab41541 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 1 Dec 2020 16:17:37 +0900 Subject: [PATCH] drivers/mtd/n25qxxx.c: Fix syslog formats --- drivers/mtd/n25qxxx.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/n25qxxx.c b/drivers/mtd/n25qxxx.c index 5cfc35df954..7fc9b5768a5 100644 --- a/drivers/mtd/n25qxxx.c +++ b/drivers/mtd/n25qxxx.c @@ -42,6 +42,7 @@ #include +#include #include #include #include @@ -942,8 +943,8 @@ static int n25qxxx_write_page(struct n25qxxx_dev_s *priv, FAR const uint8_t *buf if (ret < 0) { - ferr("ERROR: QSPI_MEMORY failed writing address=%06x\n", - address); + ferr("ERROR: QSPI_MEMORY failed writing address=%06jx\n", + (intmax_t)address); return ret; } @@ -1022,7 +1023,8 @@ static FAR uint8_t *n25qxxx_read_cache(struct n25qxxx_dev_s *priv, off_t sector) shift = priv->sectorshift - N25QXXX_SECTOR512_SHIFT; esectno = sector >> shift; - finfo("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift); + finfo("sector: %jd esectno: %jd shift=%d\n", + (intmax_t)sector, (intmax_t)esectno, shift); /* Check if the requested erase block is already in the cache */ @@ -1090,7 +1092,8 @@ static void n25qxxx_erase_cache(struct n25qxxx_dev_s *priv, off_t sector) if (!IS_ERASED(priv)) { off_t esectno = sector >> (priv->sectorshift - N25QXXX_SECTOR512_SHIFT); - finfo("sector: %ld esectno: %d\n", sector, esectno); + finfo("sector: %jd esectno: %jd\n", + (intmax_t)sector, (intmax_t)esectno); DEBUGVERIFY(n25qxxx_erase_sector(priv, esectno)); SET_ERASED(priv); @@ -1134,7 +1137,8 @@ static int n25qxxx_write_cache(FAR struct n25qxxx_dev_s *priv, if (!IS_ERASED(priv)) { off_t esectno = sector >> (priv->sectorshift - N25QXXX_SECTOR512_SHIFT); - finfo("sector: %ld esectno: %d\n", sector, esectno); + finfo("sector: %jd esectno: %jd\n", + (intmax_t)sector, (intmax_t)esectno); ret = n25qxxx_erase_sector(priv, esectno); if (ret < 0) @@ -1350,7 +1354,8 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) #endif ret = OK; - finfo("blocksize: %d erasesize: %d neraseblocks: %d\n", + finfo("blocksize: %" PRId32 " erasesize: %" PRId32 + " neraseblocks: %" PRId32 "\n", geo->blocksize, geo->erasesize, geo->neraseblocks); } }