From 565a67262bc608ef8ad0a43e71c7ce79d53b0777 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 11 Nov 2020 16:11:39 +0900 Subject: [PATCH] drivers/mtd/mtd_partition.c: Fix printf format warnings --- drivers/mtd/mtd_partition.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index f0f92f46dd8..32d59cfe2c5 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -629,14 +629,15 @@ static ssize_t part_procfs_read(FAR struct file *filep, FAR char *buffer, /* Terminate the partition name and add to output buffer */ - ret = snprintf(&buffer[total], buflen - total, "%s%7d %7d %s\n", - partname, attr->nextpart->firstblock / blkpererase, - attr->nextpart->neraseblocks, + ret = snprintf(&buffer[total], buflen - total, "%s%7ju %ju %s\n", + partname, + (uintmax_t)attr->nextpart->firstblock / blkpererase, + (uintmax_t)attr->nextpart->neraseblocks, attr->nextpart->parent->name); #else - ret = snprintf(&buffer[total], buflen - total, "%7d %7d %s\n", - attr->nextpart->firstblock / blkpererase, - attr->nextpart->neraseblocks, + ret = snprintf(&buffer[total], buflen - total, "%7ju %7ju %s\n", + (uintmax_t)attr->nextpart->firstblock / blkpererase, + (uintmax_t)attr->nextpart->neraseblocks, attr->nextpart->parent->name); #endif