mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
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>
This commit is contained in:
parent
9bd76b8076
commit
fd374665c9
1 changed files with 1 additions and 1 deletions
2
env/mmc.c
vendored
2
env/mmc.c
vendored
|
@ -73,7 +73,7 @@ static inline s64 mmc_offset(int copy)
|
|||
.partition = "u-boot,mmc-env-partition",
|
||||
.offset = "u-boot,mmc-env-offset",
|
||||
};
|
||||
s64 val, defvalue;
|
||||
s64 val = 0, defvalue;
|
||||
const char *propname;
|
||||
const char *str;
|
||||
int err;
|
||||
|
|
Loading…
Reference in a new issue