mtd: part: fix incorrect format specifier for an unsigned long long
authorColin Ian King <colin.king@canonical.com>
Thu, 31 Jan 2019 14:08:20 +0000 (14:08 +0000)
committerRichard Weinberger <richard@nod.at>
Mon, 6 May 2019 19:57:06 +0000 (21:57 +0200)
An unsigned long long is being formatted with %lld instead of the unsigned
version %llu. Fix this.

Clean up cppcheck warning:
%lld in format string (no. 1) requires 'long long' but the argument type
is 'unsigned long long'.

Fixes: a62c24d75529 ("mtd: part: Add sysfs variable for offset of partition")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/mtdpart.c

index 37f174ccbcec4b1f10d0af717707a38fa46d4499..dfa241ad018b3e7f0e35510eb170ef061c842ac1 100644 (file)
@@ -572,7 +572,7 @@ static ssize_t mtd_partition_offset_show(struct device *dev,
 {
        struct mtd_info *mtd = dev_get_drvdata(dev);
        struct mtd_part *part = mtd_to_part(mtd);
-       return snprintf(buf, PAGE_SIZE, "%lld\n", part->offset);
+       return snprintf(buf, PAGE_SIZE, "%llu\n", part->offset);
 }
 
 static DEVICE_ATTR(offset, S_IRUGO, mtd_partition_offset_show, NULL);