summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>2011-04-20 12:35:09 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-21 15:43:39 +0300
commit897125577fe136a7a1dead23b61f9ae861a93356 (patch)
treed152055d2938b5688328d2544239b47ecd9d4978
parentd73400d6ec870b2651b135e75352466e09c2a17f (diff)
libmtd: use PRIu64 classifier for uint64_t printf arguments
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--lib/libmtd.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/libmtd.c b/lib/libmtd.c
index 418ba29..7fabd80 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -31,9 +31,11 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
-#include <mtd/mtd-user.h>
+#include <inttypes.h>
+#include <mtd/mtd-user.h>
#include <libmtd.h>
+
#include "libmtd_int.h"
#include "common.h"
@@ -1096,19 +1098,16 @@ int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
max_offs = (unsigned long long)mtd->eb_cnt * mtd->eb_size;
if (start >= max_offs) {
- errmsg("bad page address %llu, mtd%d has %d eraseblocks "
- "(%llu bytes)", (unsigned long long) start, mtd->mtd_num,
- mtd->eb_cnt, max_offs);
+ errmsg("bad page address %" PRIu64 ", mtd%d has %d eraseblocks (%llu bytes)",
+ start, mtd->mtd_num, mtd->eb_cnt, max_offs);
errno = EINVAL;
return -1;
}
oob_offs = start & (mtd->min_io_size - 1);
if (oob_offs + length > mtd->oob_size || length == 0) {
- errmsg("Cannot write %llu OOB bytes to address %llu "
- "(OOB offset %u) - mtd%d OOB size is only %d bytes",
- (unsigned long long)length, (unsigned long long)start,
- oob_offs, mtd->mtd_num, mtd->oob_size);
+ errmsg("Cannot write %" PRIu64 " OOB bytes to address %" PRIu64 " (OOB offset %u) - mtd%d OOB size is only %d bytes",
+ length, start, oob_offs, mtd->mtd_num, mtd->oob_size);
errno = EINVAL;
return -1;
}
@@ -1125,10 +1124,8 @@ int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
if (errno != ENOTTY ||
lib->offs64_ioctls != OFFS64_IOCTLS_UNKNOWN) {
- sys_errmsg("%s ioctl failed for mtd%d, offset %llu "
- "(eraseblock %llu)", cmd64_str, mtd->mtd_num,
- (unsigned long long)start,
- (unsigned long long)start / mtd->eb_size);
+ sys_errmsg("%s ioctl failed for mtd%d, offset %" PRIu64 " (eraseblock %" PRIu64 ")",
+ cmd64_str, mtd->mtd_num, start, start / mtd->eb_size);
}
/*
@@ -1152,10 +1149,8 @@ int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
ret = ioctl(fd, cmd, &oob);
if (ret < 0)
- sys_errmsg("%s ioctl failed for mtd%d, offset %llu "
- "(eraseblock %llu)", cmd_str, mtd->mtd_num,
- (unsigned long long)start,
- (unsigned long long)start / mtd->eb_size);
+ sys_errmsg("%s ioctl failed for mtd%d, offset %" PRIu64 " (eraseblock %" PRIu64 ")",
+ cmd_str, mtd->mtd_num, start, start / mtd->eb_size);
return ret;
}