include/env.h: use plain old #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
PATCH 1/1 include/env.h: use plain old #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Commit 9f1807e57cb ("env: add env_set_runtime() helper") broke the use of "make envtools" to create the target fw_setenv/fw_printenv binaries. The problem is that the #include <config.h>, in addition to pulling in linux/kconfig.h to get the IS_ENABLED() helper, also ends up pulling in lots of architecture/board specific headers.
Fix it by simply using an #ifdef.
---
Tom said "Just using a normal #if/#else/#endif would be the better fix here." so here it is.
I'm still far from convinced of the value of this helper, but if the tq-group folks want it it's not a hill I'm gonna die on, I just want to be able to build and ship v2026.07.
include/env.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/env.h +4 -4
@@ -9,7 +9,6 @@#ifndef __ENV_H#define __ENV_H -#include <config.h> #include <compiler.h> #include <stdbool.h> #include <linux/types.h>
@@ -174,10 +173,11 @@ int env_set(const char *varname, const char *value);*/ static inline int env_set_runtime (const char *varname,const char *value) { -if (IS_ENABLED (CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG )) -return env_set (varname, value); - +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG +return env_set (varname, value); +#else return 0 ; +#endif }/**
Signature · 1 line
2.55.0
Quoted 9 lines · Rasmus Villemoes
Commit
9f1807e57cb("env: addenv_set_runtime()helper") broke the use of "make envtools" to create the target fw_setenv/fw_printenv binaries. The problem is that the #include <config.h>, in addition to pulling inlinux/kconfig.hto get theIS_ENABLED()helper, also ends up pulling in lots of architecture/board specific headers.Fix it by simply using an #ifdef.
Signed-off-by Rasmus Villemoes <[email protected]>
Thanks for picking this issue up.
Signature · 1 line
Tom
Quoted 10 lines · Rasmus Villemoes
Commit
9f1807e57cb("env: addenv_set_runtime()helper") broke the use of "make envtools" to create the target fw_setenv/fw_printenv binaries. The problem is that the #include <config.h>, in addition to pulling inlinux/kconfig.hto get theIS_ENABLED()helper, also ends up pulling in lots of architecture/board specific headers.Fix it by simply using an #ifdef.
Signed-off-by Rasmus Villemoes <[email protected]>---
Signature · 7 lines
Best regards, Max TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider http://www.tq-group.com/
Quoted 9 lines · Rasmus Villemoes
Commit
9f1807e57cb("env: addenv_set_runtime()helper") broke the use of "make envtools" to create the target fw_setenv/fw_printenv binaries. The problem is that the #include <config.h>, in addition to pulling inlinux/kconfig.hto get theIS_ENABLED()helper, also ends up pulling in lots of architecture/board specific headers.Fix it by simply using an #ifdef.
[...]
Applied to u-boot/main, thanks!
[1/1] include/env.h: use plain old #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
commit: c46bd5b2136158d3380d626d79c96827818226c5
Signature · 1 line
Tom