[PATCH 2/2] tools: env: Avoid an uninited warning with was_locked

Simon Glass sjg at chromium.org
Sat Aug 1 18:30:39 CEST 2020


Set this variable to 0 to avoid a warning about an unused variable. This
happens on gcc 7.5.0 for me.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/env/fw_env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index ccbeb5552bc..66cb9d2a25e 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -995,7 +995,7 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count)
 				   of the data */
 	loff_t blockstart;	/* running start of the current block -
 				   MEMGETBADBLOCK needs 64 bits */
-	int was_locked;		/* flash lock flag */
+	int was_locked = 0;	/* flash lock flag */
 	int rc;
 
 	/*
-- 
2.28.0.163.g6104cc2f0b6-goog



More information about the U-Boot mailing list