From patchwork Thu Feb 12 08:53:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 23006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 6CFBCDDD0B for ; Thu, 12 Feb 2009 19:43:06 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LXX7G-0006N6-AE; Thu, 12 Feb 2009 08:40:14 +0000 Received: from smtp.nokia.com ([192.100.122.230] helo=mgw-mx03.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LXX7A-0006LO-CB for linux-mtd@lists.infradead.org; Thu, 12 Feb 2009 08:40:11 +0000 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx03.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n1C8dOFd026964 for ; Thu, 12 Feb 2009 10:40:03 +0200 Received: from vaebh102.NOE.Nokia.com ([10.160.244.23]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Feb 2009 10:39:28 +0200 Received: from vaebe112.NOE.Nokia.com ([10.160.244.81]) by vaebh102.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Feb 2009 10:39:28 +0200 Received: from [172.21.41.224] ([172.21.41.224]) by vaebe112.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Feb 2009 10:39:28 +0200 Message-ID: <4993E37E.7070702@nokia.com> Date: Thu, 12 Feb 2009 10:53:18 +0200 From: Adrian Hunter User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: linux-mtd Mailing List Subject: [PATCH] mkfs.ubifs: eliminate compiler warnings X-OriginalArrivalTime: 12 Feb 2009 08:39:28.0918 (UTC) FILETIME=[6B203360:01C98CED] X-Nokia-AV: Clean X-Spam-Score: -4.0 (----) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (-4.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.100.122.230 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The warnings were: lpt.c: In function ‘create_lpt’: lpt.c:552: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long int’ mkfs.ubifs.c: In function ‘do_openat’: mkfs.ubifs.c:251: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result mkfs.ubifs.c: In function ‘get_options’: mkfs.ubifs.c:542: warning: format not a string literal and no format arguments Signed-off-by: Adrian Hunter --- mkfs.ubifs/lpt.c | 2 +- mkfs.ubifs/mkfs.ubifs.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mkfs.ubifs/lpt.c b/mkfs.ubifs/lpt.c index c8fb22c..f6d4352 100644 --- a/mkfs.ubifs/lpt.c +++ b/mkfs.ubifs/lpt.c @@ -549,7 +549,7 @@ int create_lpt(struct ubifs_info *c) c->nhead_lnum = lnum; c->nhead_offs = ALIGN(len, c->min_io_size); - dbg_msg(1, "lpt_sz: %d", c->lpt_sz); + dbg_msg(1, "lpt_sz: %lld", c->lpt_sz); dbg_msg(1, "space_bits: %d", c->space_bits); dbg_msg(1, "lpt_lnum_bits: %d", c->lpt_lnum_bits); dbg_msg(1, "lpt_offs_bits: %d", c->lpt_offs_bits); diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c index 6c4e912..bedf8a7 100644 --- a/mkfs.ubifs/mkfs.ubifs.c +++ b/mkfs.ubifs/mkfs.ubifs.c @@ -248,7 +248,8 @@ static int do_openat(int fd, const char *path, int flags) ret = fchdir(fd); if (ret != -1) ret = open(path, flags); - chdir(cwd); + if (chdir(cwd) && !ret) + ret = -1; free(cwd); return ret; } @@ -539,7 +540,7 @@ static int get_options(int argc, char**argv) break; case 'h': case '?': - printf(helptext); + printf("%s", helptext); exit(0); case 'v': verbose = 1;