From d263fc076ff88bc218cd245ecb2107267b376cc7 Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Mon, 5 Sep 2011 23:40:13 +0200 Subject: [PATCH] fix compile warning for env tools MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch fixes this issue: fw_env.c: In function ‘fw_setenv’: fw_env.c:492:5: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat] fw_env.c: In function ‘flash_write_buf’: fw_env.c:806:6: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat] Signed-off-by: Luka Perkov Acked-by: Mike Frysinger [sw0312.kim: backport mainline commit 8603b69b8b04 to remove gcc 9 build warning] Signed-off-by: Seung-Woo Kim Change-Id: I333ce3a5bf4caf3eed4272cf79b837eab48776a0 --- tools/env/fw_env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 8ff7052..3682cda 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -488,7 +488,7 @@ int fw_setenv(int argc, char *argv[]) value = (char *)malloc(len - strlen(name)); if (!value) { fprintf(stderr, - "Cannot malloc %u bytes: %s\n", + "Cannot malloc %zu bytes: %s\n", len - strlen(name), strerror(errno)); return -1; } @@ -806,7 +806,7 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count, data = malloc (erase_len); if (!data) { fprintf (stderr, - "Cannot malloc %u bytes: %s\n", + "Cannot malloc %zu bytes: %s\n", erase_len, strerror (errno)); return -1; } -- 2.7.4