diff options
author | Patrick Delaunay <patrick.delaunay@foss.st.com> | 2022-11-10 11:49:00 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-10 12:37:09 -0500 |
commit | 8566050e247bacb734a57a2529f49139f2c63dce (patch) | |
tree | 4df6813a90a952362cc571be80e68dd46e7b6906 /env | |
parent | 46c9016b7f794ce8761e12b4b971be061dd861a3 (diff) | |
download | u-boot-8566050e247bacb734a57a2529f49139f2c63dce.zip u-boot-8566050e247bacb734a57a2529f49139f2c63dce.tar.gz u-boot-8566050e247bacb734a57a2529f49139f2c63dce.tar.bz2 |
env: mcc: fix compilation error with ENV_IS_EMBEDDED
When ENV_IS_EMBEDDED is enabled, ret is not defined but is used as a
return value in env_mmc_load().
This patch correct this issue and simplify the existing code, test only
one time #if defined(ENV_IS_EMBEDDED) and not in the function.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'env')
-rw-r--r-- | env/mmc.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -353,10 +353,14 @@ static inline int read_env(struct mmc *mmc, unsigned long size, return (n == blk_cnt) ? 0 : -1; } -#if defined(CONFIG_SYS_REDUNDAND_ENVIRONMENT) +#if defined(ENV_IS_EMBEDDED) +static int env_mmc_load(void) +{ + return 0; +} +#elif defined(CONFIG_SYS_REDUNDAND_ENVIRONMENT) static int env_mmc_load(void) { -#if !defined(ENV_IS_EMBEDDED) struct mmc *mmc; u32 offset1, offset2; int read1_fail = 0, read2_fail = 0; @@ -408,13 +412,11 @@ err: if (ret) env_set_default(errmsg, 0); -#endif return ret; } #else /* ! CONFIG_SYS_REDUNDAND_ENVIRONMENT */ static int env_mmc_load(void) { -#if !defined(ENV_IS_EMBEDDED) ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); struct mmc *mmc; u32 offset; @@ -453,7 +455,7 @@ fini: err: if (ret) env_set_default(errmsg, 0); -#endif + return ret; } #endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */ |