public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Adrian Hunter <ext-adrian.hunter@nokia.com>
To: linux-mtd Mailing List <linux-mtd@lists.infradead.org>
Subject: [PATCH] mkfs.ubifs: eliminate compiler warnings
Date: Thu, 12 Feb 2009 10:53:18 +0200	[thread overview]
Message-ID: <4993E37E.7070702@nokia.com> (raw)

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 <ext-adrian.hunter@nokia.com>
---
 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;
-- 
1.5.6.3

             reply	other threads:[~2009-02-12  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12  8:53 Adrian Hunter [this message]
2009-02-12  8:48 ` [PATCH] mkfs.ubifs: eliminate compiler warnings Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4993E37E.7070702@nokia.com \
    --to=ext-adrian.hunter@nokia.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox