@@ -47,14 +47,11 @@ int env_get_yesno(const char *var)
char *env_get_default(const char *name)
{
char *ret_val;
- unsigned long really_valid = gd->env_valid;
unsigned long real_gd_flags = gd->flags;
/* Pretend that the image is bad. */
gd->flags &= ~GD_FLG_ENV_READY;
- gd->env_valid = ENV_INVALID;
ret_val = env_get(name);
- gd->env_valid = really_valid;
gd->flags = real_gd_flags;
return ret_val;
}
@@ -141,7 +141,7 @@ int env_get_char(int index)
struct env_driver *drv;
int prio;
- if (gd->env_valid == ENV_INVALID)
+ if (!(gd->flags & GD_FLG_ENV_READY))
return default_environment[index];
for (prio = 0; (drv = env_driver_lookup(ENVO_GET_CHAR, prio)); prio++) {
env_get_default To prepare the removal of env_valid in an upcoming patch, and since the ENV_READY flag in gd is enough to discriminate in env_get_char, let's update env_get_char to return the variable in the default environment when ENV_READY flag is not set and remove env_valid setting and getting from env_get_default. Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com> --- env/common.c | 3 --- env/env.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-)