All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: u-boot@lists.denx.de
Subject: [PATCH] env: Add option to only ever append environment
Date: Tue, 2 Jun 2020 08:42:34 +0200	[thread overview]
Message-ID: <7f9cd3ee-6661-4780-90cf-d2e81591a7ce@prevas.dk> (raw)
In-Reply-To: <20200529175404.627741-1-marex@denx.de>

On 29/05/2020 19.54, Marek Vasut wrote:
> +config ENV_APPEND
> +	bool "Always append the environment with new data"
> +	default n
> +	help
> +	  If defined, the environment hash table is only ever appended with new
> +	  data, but the existing hash table can never be dropped and reloaded
> +	  with newly imported data. This may be used in combination with static
> +	  flags to e.g. to protect variables which must not be modified.
> +
>  config ENV_ACCESS_IGNORE_FORCE
>  	bool "Block forced environment operations"
>  	default n
> diff --git a/env/env.c b/env/env.c
> index 024d36fdbe..967a9d36d7 100644
> --- a/env/env.c
> +++ b/env/env.c
> @@ -204,7 +204,9 @@ int env_load(void)
>  		ret = drv->load();
>  		if (!ret) {
>  			printf("OK\n");
> +#if !CONFIG_IS_ENABLED(ENV_APPEND)
>  			return 0;
> +#endif

Don't use CONFIG_IS_ENABLED() unless you actually introduce both
CONFIG_FOO and CONFIG_SPL_FOO. Otherwise the above
CONFIG_IS_ENABLED(ENV_APPEND) is guaranteed to evaluate to false in SPL.
Of course that only matters if environment support is enabled in SPL,
but some actually use that.

Rasmus

  reply	other threads:[~2020-06-02  6:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 17:54 [PATCH] env: Add option to only ever append environment Marek Vasut
2020-06-02  6:42 ` Rasmus Villemoes [this message]
2020-06-02 11:04   ` Marek Vasut
2020-06-02 12:05     ` Rasmus Villemoes
2020-06-02 12:09       ` Marek Vasut
2020-06-02 14:43         ` Tom Rini
2020-06-02 15:54           ` Marek Vasut
2020-06-02 12:44       ` Tom Rini
2020-06-02 12:47         ` Marek Vasut
2020-06-02 14:38           ` Tom Rini
2020-06-02 15:55             ` Marek Vasut
2020-06-02 16:00               ` Tom Rini
2020-06-02 16:06                 ` Marek Vasut
2020-06-02 17:36                   ` Tom Rini
2020-06-02 19:06                     ` Marek Vasut
2020-06-02 23:32                       ` Tom Rini
2020-06-02 23:42                         ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f9cd3ee-6661-4780-90cf-d2e81591a7ce@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.