
13 Oct
2011
13 Oct
'11
10:27 p.m.
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