diff mbox series

[U-Boot,v3,1/3] env: correct the check of env_flags_validate presence

Message ID 20190918092920.21435-2-patrick.delaunay@st.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series env: Add CONFIG_ENV_FULL_SUPPORT | expand

Commit Message

Patrick DELAUNAY Sept. 18, 2019, 9:29 a.m. UTC
This patch corrects the check of env_flags_validate presence because
"flags.c" is always compiled in U-Boot and CONFIG_ENV_SUPPORT
don't exist; so the macro CONFIG_IS_ENABLED(ENV_SUPPORT) only provides
the expected result for SPL and TPL (check activation of
CONFIG_SPL_ENV_SUPPORT and CONFIG_TPL_ENV_SUPPORT).

This patch solves the regression introduced by
commit 7d4776545b0f ("env: solve compilation error
in SPL"); change_ok was always NULL in U-Boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

Changes in v3: None
Changes in v2: None

 env/common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Simon Glass Sept. 27, 2019, 1:48 a.m. UTC | #1
On Wed, 18 Sep 2019 at 03:30, Patrick Delaunay <patrick.delaunay@st.com> wrote:
>
> This patch corrects the check of env_flags_validate presence because
> "flags.c" is always compiled in U-Boot and CONFIG_ENV_SUPPORT
> don't exist; so the macro CONFIG_IS_ENABLED(ENV_SUPPORT) only provides
> the expected result for SPL and TPL (check activation of
> CONFIG_SPL_ENV_SUPPORT and CONFIG_TPL_ENV_SUPPORT).
>
> This patch solves the regression introduced by
> commit 7d4776545b0f ("env: solve compilation error
> in SPL"); change_ok was always NULL in U-Boot.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  env/common.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/env/common.c b/env/common.c
index 3fb60509dd..f677b5b0da 100644
--- a/env/common.c
+++ b/env/common.c
@@ -24,8 +24,10 @@  DECLARE_GLOBAL_DATA_PTR;
 #include <env_default.h>
 
 struct hsearch_data env_htab = {
-#if CONFIG_IS_ENABLED(ENV_SUPPORT)
-	/* defined in flags.c, only compile with ENV_SUPPORT */
+#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(ENV_SUPPORT)
+	/* defined in flags.c, only compiled in U-Boot or
+	 * with $(SPL_TPL_)ENV_SUPPORT
+	 */
 	.change_ok = env_flags_validate,
 #endif
 };