[U-Boot] [PATCH] fw_env: use vars from the board config

Marek Vasut marek.vasut at gmail.com
Mon Jan 2 17:38:55 CET 2012


Cc u-boot ML please.

> 2012/1/2 Marek Vasut <marek.vasut at gmail.com>
> 
> > > it is quite odd that fw_printenv/fw_setenv does not
> > > use the settings from include/configs but instead
> > > redefines things.
> > > 
> > > This patch uses the variables from the config file
> > > The edit in fw_env.c is only needed to resolve a name clash
> > > 
> > > Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>
> > > 
> > > ---
> > > 
> > > Note: this is more intended to get some feedback.
> > > (also to see if I am on the right track)
> > > I did test the changes locally.
> > > 
> > > (and yes, I know there are some more things that could be cleaned up).
> > > ---
> > > 
> > >  tools/env/fw_env.c |   20 ++++++++++----------
> > >  tools/env/fw_env.h |   36 ++++++++++++++++--------------------
> > >  2 files changed, 26 insertions(+), 30 deletions(-)
> > > 
> > > diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
> > > index 996682e..6597fbf 100644
> > > --- a/tools/env/fw_env.c
> > > +++ b/tools/env/fw_env.c
> > > @@ -79,7 +79,7 @@ static int dev_current;
> > > 
> > >  #define ENVSECTORS(i) envdevices[(i)].env_sectors
> > >  #define DEVTYPE(i)    envdevices[(i)].mtd_type
> > > 
> > > -#define CONFIG_ENV_SIZE ENVSIZE(dev_current)
> > > +#define CFG_ENV_SIZE ENVSIZE(dev_current)
> > 
> > NAK, don't change it to CFG_... for no reason! Why did you change it ?
> > Just use
> > ENVSIZE(dev_current) instead.
> 
> I agree with that.
> As I wrote in the comment of the patch, this was mainly to get some
> feedback that I am on the right track.
> I've seen a number of places where the code of fw_env.c could be improved,
> but opted for minimal change for now, as for now I am mostly solicitating
> feedback on the changes in fw_env.h
> (and the actual reason for the change is that CONFIG_ENV_SIZE is defined
> here, but also in config.h, resulting in a naming config, a quick rename
> was the simplest way forward for now)

Let's see what the others think
> 
> And actually I feel that lines like:
> #define ENV1_SIZE         CONFIG_ENV_SIZE
> in fw_env.h are somewhat pointless and it would be better to eliminate
> ENV1_SIZE completely.
> 
> There are more cases like that. I'm happy to spent time on this, but only
> if it is felt to be useful and has any chance on being accepted.
> 
> Best regards, Frans

M


More information about the U-Boot mailing list