Hi Mike,

On Thu, Oct 13, 2011 at 1:27 PM, Mike Frysinger <[email protected]> wrote:
> On Tuesday 11 October 2011 18:26:10 Simon Glass wrote:
>> --- a/arch/arm/lib/board.c
>> +++ b/arch/arm/lib/board.c
>>
>> +/**
>> + * Decode the value of an environment variable and return it.
>> + *
>> + * @param name               Name of environemnt variable
>> + * @param base               Number base to use (normally 10, or 16 for hex)
>> + * @param default_val        Default value to return if the variable is not
>> + *                   found
>> + * @return the decoded value, or default_val if not found
>> + */
>> +static int getenv_int(const char *name, int base, int default_val)
>> +{
>> +     char tmp[64];   /* long enough for environment variables */
>> +     int i = getenv_f(name, tmp, sizeof(tmp));
>> +
>> +     return (i > 0)
>> +             ? (int) simple_strtoul(tmp, NULL, base)
>> +             : default_val;
>> +}
>
> pretty much everyone does this with gd->baudrate.  would make sense to put
> this into common/cmd_nvedit.c and convert all arches.
> -mike
>

I was worried someone might say that. I will take a look.

Regards,
Simon
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to