[U-Boot] [PATCH] powerpc/mpc85xx: Make NMG_CPU_A011 workaround conditional

York Sun yorksun at freescale.com
Thu Aug 9 01:16:21 CEST 2012


On Wed, 2012-08-08 at 15:09 -0500, Andy Fleming wrote:
> Please copy me on any 85xx U-Boot patches.
> 
> 
> >
> > +#define HWCONFIG_BUFFER_SIZE 128
> 
> 
> [...]
> 
> > +       char buffer[HWCONFIG_BUFFER_SIZE];
> > +       char *buf = NULL;
> > +
> > +       if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
> > +               buf = buffer;
> 
> 
> This seems fragile. I suppose there's no way to ensure that this
> succeeds, but we should at least check to see if the buffer we pass in
> was big enough, and let the user know that we were looking for the
> A011 erratum setting, and may not have found it because the hwconfig
> string was more than 128 characters.
> 

If the buffer isn't big enough, getenv_f() will print a message saying
that. Is that enough? Or do you prefer another warning when fsl_cpu_a011
is not detected? It seems a little bit redundant.

York





More information about the U-Boot mailing list