From 16841a6a500766662f6e5d3c07ad1595c7deaceb Mon Sep 17 00:00:00 2001
From: Peng Fan <peng.fan@nxp.com>
Date: Fri, 19 Mar 2021 15:56:53 +0800
Subject: [PATCH] tools: imx image: fix write warning
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

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@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.39.5