From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] mkenvimage: Fix compiler warning
Date: Fri, 6 Apr 2012 11:15:07 +0200 [thread overview]
Message-ID: <1333703707-10193-1-git-send-email-dirk.behme@gmail.com> (raw)
From: Dirk Behme <dirk.behme@googlemail.com>
Fix the compiler warning
mkenvimage.c: In function ?main?:
mkenvimage.c:218: warning: format ?%ld? expects type ?long int?, but argument 3 has type ?unsigned int?
mkenvimage.c:226: warning: format ?%ld? expects type ?long int?, but argument 3 has type ?unsigned int?
introduced with the commit
mkenvimage: Use mmap() when reading from a regular file
6ee39f8055680654f9cc97b98dcce9588f1ab71e
Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
CC: David Wagner <david.wagner@free-electrons.com>
CC: Anatolij Gustschin <agust@denx.de>
CC: Mike Frysinger <vapier@gentoo.org>
---
Changes in v2: Use size_t formatter '%zu'.
tools/mkenvimage.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index 9dbb3b2..bfc4eb6 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
filebuf = mmap(NULL, sizeof(*envptr) * filesize, PROT_READ,
MAP_PRIVATE, txt_fd, 0);
if (filebuf == MAP_FAILED) {
- fprintf(stderr, "mmap (%ld bytes) failed: %s\n",
+ fprintf(stderr, "mmap (%zu bytes) failed: %s\n",
sizeof(*envptr) * filesize,
strerror(errno));
fprintf(stderr, "Falling back to read()\n");
@@ -221,7 +221,7 @@ int main(int argc, char **argv)
filebuf = malloc(sizeof(*envptr) * filesize);
ret = read(txt_fd, filebuf, sizeof(*envptr) * filesize);
if (ret != sizeof(*envptr) * filesize) {
- fprintf(stderr, "Can't read the whole input file (%ld bytes): %s\n",
+ fprintf(stderr, "Can't read the whole input file (%zu bytes): %s\n",
sizeof(*envptr) * filesize,
strerror(errno));
--
1.7.7.4
next reply other threads:[~2012-04-06 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-06 9:15 Dirk Behme [this message]
2012-04-06 15:14 ` [U-Boot] [PATCH v2] mkenvimage: Fix compiler warning Mike Frysinger
2012-04-06 18:48 ` David Wagner
2012-04-10 21:55 ` Anatolij Gustschin
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=1333703707-10193-1-git-send-email-dirk.behme@gmail.com \
--to=dirk.behme@googlemail.com \
--cc=u-boot@lists.denx.de \
/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