[U-Boot] [PATCH v4 02/27] env: allow flash and nand env driver to compile together

York Sun york.sun at nxp.com
Fri Oct 26 14:30:41 UTC 2018


On 10/12/18 07:45, Rajesh Bhagat wrote:
> Define env_ptr as static in flash and nand env driver to
> allow these to compile together.
> 
> Signed-off-by: Rajesh Bhagat <rajesh.bhagat at nxp.com>
> ---
> Change in v4: None
> 
> Change in v3:
>  - Merged env nand specific patches to remove compilation warning
> 
> Change in v2: None
> 
>  env/flash.c           | 4 ++--
>  env/nand.c            | 6 ++----
>  include/environment.h | 1 -
>  3 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/env/flash.c b/env/flash.c
> index 32236c716e..33b199f05b 100644
> --- a/env/flash.c
> +++ b/env/flash.c
> @@ -45,13 +45,13 @@ DECLARE_GLOBAL_DATA_PTR;
>  #endif
>  
>  #ifdef ENV_IS_EMBEDDED
> -env_t *env_ptr = &environment;
> +static env_t *env_ptr = &environment;
>  
>  static __maybe_unused env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR;
>  
>  #else /* ! ENV_IS_EMBEDDED */
>  
> -env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
> +static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
>  static __maybe_unused env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR;
>  #endif /* ENV_IS_EMBEDDED */
>  

Compiling warning env_ptr defined but not used for boards mccmon6_sd and
mccmon6_nor. Please check.

York


More information about the U-Boot mailing list