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.

Signed-off-by: Rasmus Villemoes <[email protected]>
---

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(-)

diff --git a/include/env.h b/include/env.h
index 9b872fb26eb..8bd6cf23932 100644
--- a/include/env.h
+++ b/include/env.h
@@ -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
 }
 
 /**
-- 
2.55.0

Reply via email to