]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: env: Avoid an uninited warning with was_locked
authorSimon Glass <sjg@chromium.org>
Sat, 1 Aug 2020 16:30:39 +0000 (10:30 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 5 Aug 2020 12:18:34 +0000 (08:18 -0400)
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@chromium.org>
tools/env/fw_env.c

index ccbeb5552bca852461030ce2f1707803d0937a4a..66cb9d2a25e6ba6f64f82f6a9846b5f2d73e6a26 100644 (file)
@@ -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;
 
        /*