Commit fd374665c9b724bb3eb0da32db0bb7ecc5cf1337

Authored by Philipp Tomsich
Committed by Tom Rini
1 parent 9bd76b8076

env: suppress a spurious warning with GCC 7.1

GCC 7.1 seems to be smart enough to track val through the various
static inline functions, but not smart enough to see that val will
always be initialised when no error is returned.  This triggers
the following warning:
  env/mmc.c: In function 'mmc_get_env_addr':
  env/mmc.c:121:12: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]

To make it easier for compiler to understand what is going on, let's
initialise val.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -73,7 +73,7 @@
73 73 .partition = "u-boot,mmc-env-partition",
74 74 .offset = "u-boot,mmc-env-offset",
75 75 };
76   - s64 val, defvalue;
  76 + s64 val = 0, defvalue;
77 77 const char *propname;
78 78 const char *str;
79 79 int err;