summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-08-21 10:19:25 -0600
committerTom Rini <[email protected]>2024-08-26 14:06:08 -0600
commit66ca5b78640578d6176031b3cc1018dc4e550dd3 (patch)
tree9ea8c5d1803c7c8ad48e1db03b2965912d5cc30b /common
parentd9902107027a41fc6a27b10f6e030c5a2465936b (diff)
global_data: Remove environment members if not used
If the environment is not enabled we don't need these fields in global_data. Make them conditional. Make these fields conditional. Move env_buf up one so it can share an #ifdef. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'common')
-rw-r--r--common/hwconfig.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/hwconfig.c b/common/hwconfig.c
index afaa6cb37ab..25a8cd5bf5d 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -77,7 +77,13 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
/* if we are passed a buffer use it, otherwise try the environment */
if (!env_hwconfig) {
- if (!(gd->flags & GD_FLG_ENV_READY) && gd->env_valid != ENV_VALID) {
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
+ if (!(gd->flags & GD_FLG_ENV_READY) &&
+ gd->env_valid != ENV_VALID)
+#else
+ if (true)
+#endif
+ {
printf("WARNING: Calling __hwconfig without a buffer "
"and before environment is ready\n");
return NULL;