public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] tools: env: Fix format warnings in debug
@ 2016-05-06 12:58 Marcin Niestroj
  2016-05-06 12:58 ` [U-Boot] [PATCH 2/2] tools: env: Add support for direct read/write UBI volumes Marcin Niestroj
  2016-05-20 13:37 ` [U-Boot] [PATCH 1/2] tools: env: Fix format warnings in debug Marcin Niestroj
  0 siblings, 2 replies; 5+ messages in thread
From: Marcin Niestroj @ 2016-05-06 12:58 UTC (permalink / raw)
  To: u-boot

Format warnings (-Wformat) were shown in printf() calls after defining
DEBUG macro.

Update format string and explicitly cast variables to suppress all
warnings.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
---
 tools/env/fw_env.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 06cf63d..b4b542a 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -649,8 +649,8 @@ static int flash_bad_block (int fd, uint8_t mtd_type, loff_t *blockstart)
 
 		if (badblock) {
 #ifdef DEBUG
-			fprintf (stderr, "Bad block at 0x%llx, "
-				 "skipping\n", *blockstart);
+			fprintf (stderr, "Bad block at 0x%llx, skipping\n",
+				(unsigned long long) *blockstart);
 #endif
 			return badblock;
 		}
@@ -737,7 +737,8 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,
 		}
 #ifdef DEBUG
 		fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n",
-			 rc, blockstart + block_seek, DEVNAME(dev));
+			rc, (unsigned long long) blockstart + block_seek,
+			DEVNAME(dev));
 #endif
 		processed += readlen;
 		readlen = min (blocklen, count - processed);
@@ -835,8 +836,9 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
 		if (block_seek + count != write_total) {
 			if (block_seek != 0)
 				fprintf(stderr, " and ");
-			fprintf(stderr, "0x%lx - 0x%x",
-				block_seek + count, write_total - 1);
+			fprintf(stderr, "0x%lx - 0x%lx",
+				(unsigned long) block_seek + count,
+				(unsigned long) write_total - 1);
 		}
 		fprintf(stderr, "\n");
 #endif
@@ -899,8 +901,9 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
 		}
 
 #ifdef DEBUG
-		fprintf(stderr, "Write 0x%x bytes at 0x%llx\n", erasesize,
-			blockstart);
+		fprintf(stderr, "Write 0x%llx bytes at 0x%llx\n",
+			(unsigned long long) erasesize,
+			(unsigned long long) blockstart);
 #endif
 		if (write (fd, data + processed, erasesize) != erasesize) {
 			fprintf (stderr, "Write error on %s: %s\n",
-- 
2.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-26  6:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-06 12:58 [U-Boot] [PATCH 1/2] tools: env: Fix format warnings in debug Marcin Niestroj
2016-05-06 12:58 ` [U-Boot] [PATCH 2/2] tools: env: Add support for direct read/write UBI volumes Marcin Niestroj
2016-05-20 13:37   ` Marcin Niestroj
2016-07-26  6:36   ` [U-Boot] [U-Boot, " Heiko Schocher
2016-05-20 13:37 ` [U-Boot] [PATCH 1/2] tools: env: Fix format warnings in debug Marcin Niestroj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox