tools: env: Fix printf() warning in fw_env
PATCH 1/2 tools: env: Fix printf() warning in fw_env
The printf() string produces a warning about %d not matching size_t. Fix it and put the format string on one line to avoid a checkpatch warning.
---
tools/env/fw_env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/env/fw_env.c +2 -2
@@ -952,8 +952,8 @@ static int flash_read_buf(int dev, int fd, void *buf, size_t count,return -1 ; }if (rc != readlen) { -fprintf (stderr,"Read error on %s: " -"Attempted to read %d bytes but got %d\n" , +fprintf (stderr, +"Read error on %s: Attempted to read %zd bytes but got %d\n" ,DEVNAME (dev), readlen, rc);return -1 ; }
Signature · 1 line
2.28.0.163.g6104cc2f0b6-goog
PATCH 2/2 tools: env: Avoid an uninited warning with was_locked
Set this variable to 0 to avoid a warning about an unused variable. This happens on gcc 7.5.0 for me.
---
tools/env/fw_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/env/fw_env.c +1 -1
@@ -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;/*
Signature · 1 line
2.28.0.163.g6104cc2f0b6-goog
PATCH 2/2 tools: env: Avoid an uninited warning with was_locked
Quoted 4 lines · Simon Glass
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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200805/147e362d/attachment.sig>
PATCH 1/2 tools: env: Fix printf() warning in fw_env
In reply to Simon GlassQuoted 4 lines · Simon Glass
The
printf()string produces a warning about %d not matchingsize_t. Fix it and put the format string on one line to avoid a checkpatch warning.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200805/84424caa/attachment.sig>