From patchwork Tue Apr 19 08:34:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shevchenko Andriy (EXT-Teleca/Helsinki)" X-Patchwork-Id: 91935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0DC76B6F29 for ; Tue, 19 Apr 2011 18:36:37 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QC6Oq-0000z8-6c; Tue, 19 Apr 2011 08:35:08 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1QC6Oo-00038u-9m; Tue, 19 Apr 2011 08:35:06 +0000 Received: from smtp.nokia.com ([147.243.1.47] helo=mgw-sa01.nokia.com) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QC6Ol-00038J-0G for linux-mtd@lists.infradead.org; Tue, 19 Apr 2011 08:35:04 +0000 Received: from nokia.com (localhost [127.0.0.1]) by mgw-sa01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p3J8Yxw7023493; Tue, 19 Apr 2011 11:34:59 +0300 Received: from fs-test.research.nokia.com ([esdhcp05135.research.nokia.com [172.21.51.35]]) by mgw-sa01.nokia.com with ESMTP id p3J8YUlw023114 ; Tue, 19 Apr 2011 11:34:31 +0300 Received: by fs-test.research.nokia.com (Postfix, from userid 1001) id 880A9CE09C; Tue, 19 Apr 2011 11:34:43 +0300 (EEST) From: Andy Shevchenko To: Artem Bityutskiy , linux-mtd@lists.infradead.org, Mike Frysinger Subject: [PATCHv3 2/3] libmtd: use PRIu64 classifier for uint64_t printf arguments Date: Tue, 19 Apr 2011 11:34:40 +0300 Message-Id: <82d06f0b9f3ad538d5a8dabfce6ac8337e07b0ae.1303202005.git.ext-andriy.shevchenko@nokia.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <971bada1c870aa0baf6e8d07784f95e31bb98213.1303202005.git.ext-andriy.shevchenko@nokia.com> In-Reply-To: <971bada1c870aa0baf6e8d07784f95e31bb98213.1303202005.git.ext-andriy.shevchenko@nokia.com> References: <1303195429.2779.2.camel@localhost> <971bada1c870aa0baf6e8d07784f95e31bb98213.1303202005.git.ext-andriy.shevchenko@nokia.com> References: <971bada1c870aa0baf6e8d07784f95e31bb98213.1303202005.git.ext-andriy.shevchenko@nokia.com> X-Nokia-AV: Clean X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110419_043503_336367_A0B952F9 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 TVD_RCVD_SPACE_BRACKET TVD_RCVD_SPACE_BRACKET -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [147.243.1.47 listed in list.dnswl.org] Cc: Andy Shevchenko X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Andy Shevchenko --- lib/libmtd.c | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/libmtd.c b/lib/libmtd.c index 418ba29..6901a27 100644 --- a/lib/libmtd.c +++ b/lib/libmtd.c @@ -31,9 +31,11 @@ #include #include #include -#include +#include +#include #include + #include "libmtd_int.h" #include "common.h" @@ -1096,19 +1098,17 @@ 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 +1125,9 @@ 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 +1151,9 @@ 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; }