[PATCH v4 01/10] env: nowhere: set default enviroment

Wolfgang Denk wd at denx.de
Mon Jan 27 14:34:17 CET 2020


Dear Keerthy,

In message <f93caaca-f041-a6fb-2a09-d588451d854c at ti.com> you wrote:
> 
> >> Set default enviroment so that set_env calls succeed when only
> >> ENV_IS_NOWHERE set.
> >>
> >> Signed-off-by: Keerthy <j-keerthy at ti.com>
> >> ---
> >>
> >> Changes in v4:
> >>
> >>    * Reworded commit log
> >>
> >>   env/nowhere.c | 1 +
> >>   1 file changed, 1 insertion(+)
> >>
> >> diff --git a/env/nowhere.c b/env/nowhere.c
> >> index f5b0a17652..70c3b3e011 100644
> >> --- a/env/nowhere.c
> >> +++ b/env/nowhere.c
> >> @@ -23,6 +23,7 @@ static int env_nowhere_init(void)
> >>   {
> >>   	gd->env_addr	= (ulong)&default_environment[0];
> >>   	gd->env_valid	= ENV_INVALID;
> >> +	(NULL, 0);

^^^^^^^^^^^^^^^^^^^^^^
You are inserting this line of "C code" only.

> >>   	return 0;
> >>   }
> > 
> > What exactly do you mean by this?  Can you give an example or two (code
> > and/or shell) where things didn't work before but do now?  And please
> > CC Joe/Wolfgang in the future on env patches, thanks.
>
> Tom,
>
> I have a case where only ENV_IS_NOWHERE is set in SPL without any of the 
> memory based env configs like ENV_IS_IN_FAT or ENV_IS_IN_MMC. With that 
> if i try to use env_set it does not work.
>
> env_set checks for (gd->flags & GD_FLG_ENV_READY) which never is true 
> for the nowhere case and hence env_set returns 1.
>
> If any of the memory based ENV config is set i see that env_set_default 
> is called hence env_set works nicely. So we need to have env_set_default
> in the case of nowhere configuration as well.

And in which way does inserting this single line of "code" change
the behaviour?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
As far as we know, our computer has never had an undetected error.
		                                           -- Weisert


More information about the U-Boot mailing list