[PATCH v5 18/44] env: Avoid checking ENV_IS_IN when env disabled

Tom Rini trini at konsulko.com
Thu Mar 2 18:25:02 CET 2023


On Wed, Feb 22, 2023 at 09:33:59AM -0700, Simon Glass wrote:

> This check is not needed when the environment is not enabled, e.g. in
> SPL. Add a condition to handle this.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> (no changes since v1)
> 
>  cmd/nvedit.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> index 7cbc3fd573a..277293679df 100644
> --- a/cmd/nvedit.c
> +++ b/cmd/nvedit.c
> @@ -59,11 +59,13 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  #endif
>  
> +#if CONFIG_IS_ENABLED(ENV_SUPPORT)
>  #if	!defined(ENV_IS_IN_DEVICE)		&& \
>  	!defined(CONFIG_ENV_IS_NOWHERE)
>  # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
>  NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
>  #endif
> +#endif /* ENV_SUPPORT */

We need to move this kind of sanity enforcement to Kconfig, and drop the
#error.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230302/b006147e/attachment.sig>


More information about the U-Boot mailing list