[PATCH 01/26] tools: imx image: fix write warning

Peng Fan (OSS) peng.fan at oss.nxp.com
Fri Mar 19 08:56:53 CET 2021


From: Peng Fan <peng.fan at nxp.com>

Fix the warning by set the variable zero to uint64_t
"warning: ‘write’ reading 5 bytes from a region of size 4"

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 tools/imx8image.c  | 2 +-
 tools/imx8mimage.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/imx8image.c b/tools/imx8image.c
index 133780f5ea..fa8f227487 100644
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -365,7 +365,7 @@ static void copy_file (int ifd, const char *datafile, int pad, int offset)
 	struct stat sbuf;
 	unsigned char *ptr;
 	int tail;
-	int zero = 0;
+	uint64_t zero = 0;
 	uint8_t zeros[4096];
 	int size, ret;
 
diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c
index 9985b95a98..11e40ccd94 100644
--- a/tools/imx8mimage.c
+++ b/tools/imx8mimage.c
@@ -248,7 +248,7 @@ static void copy_file(int ifd, const char *datafile, int pad, int offset,
 	struct stat sbuf;
 	unsigned char *ptr;
 	int tail;
-	int zero = 0;
+	uint64_t zero = 0;
 	uint8_t zeros[4096];
 	int size, ret;
 
-- 
2.30.0



More information about the U-Boot mailing list