From: Mike Frysinger Date: Fri, 2 May 2008 22:17:50 +0000 (-0400) Subject: fix building when saveenv is disabled in some setups X-Git-Tag: v1.3.3-rc3~1^2~2 X-Git-Url: https://git.sur5r.net/?p=u-boot;a=commitdiff_plain;h=4acc2a108ad0a669165924704a6cb083f9138242 fix building when saveenv is disabled in some setups If you enable environment in the flash, but disable the embedded option, and you disable the saveenv command, then the #if nested logic will trigger a compile failure: env_flash.c: In function 'env_relocate_spec': env_flash.c:399: error: 'flash_addr' undeclared (first use in this function) The fix is to add CMD_SAVEENV ifdef protection like everywhere else. Signed-off-by: Mike Frysinger --- diff --git a/common/env_flash.c b/common/env_flash.c index eccfb62a3b..a92160ddfb 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -378,7 +378,9 @@ void env_relocate_spec (void) puts ("*** Warning - some problems detected " "reading environment; recovered successfully\n\n"); #endif /* CFG_ENV_ADDR_REDUND */ +#ifdef CMD_SAVEENV memcpy (env_ptr, (void*)flash_addr, CFG_ENV_SIZE); +#endif #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */ }