[U-Boot] [PATCH v3 2/3] Fix warnings in cmd_nvedit.c

Simon Glass sjg at chromium.org
Fri Nov 4 17:42:36 CET 2011


This printf() string should be %ld now that uintptr_t is defined
as long. Also fix a size_t error.

Signed-off-by: Simon Glass <sjg at chromium.org>
Acked-by: Mike Frysinger <vapier at gentoo.org>
---

 common/cmd_nvedit.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 396a171..8895335 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -405,7 +405,7 @@ int setenv_addr(const char *varname, const void *addr)
 {
 	char str[17];
 
-	sprintf(str, "%x", (uintptr_t)addr);
+	sprintf(str, "%lx", (uintptr_t)addr);
 	return setenv(varname, str);
 }
 
@@ -862,7 +862,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 				" - truncated\n", MAX_ENV_SIZE);
 		}
 		++size;
-		printf("## Info: input data size = %zd = 0x%zX\n", size, size);
+		printf("## Info: input data size = %zu = 0x%zX\n", size, size);
 	}
 
 	if (chk) {
-- 
1.7.3.1



More information about the U-Boot mailing list