[LinuxBIOS] [PATCH][LAR] Allow human friendly suffixes for the size option
Uwe Hermann
uwe at hermann-uwe.de
Wed Jul 11 21:37:23 CEST 2007
On Wed, Jul 11, 2007 at 11:27:53AM -0700, ron minnich wrote:
> Acked-by: Ronald G. Minnich <rminnich at gmail.com>
Yep,
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>
But some small issues:
> > +/* Add a human touch to the LAR size by allowing suffixes:
> > + XX[KkMm] where k = XX * 1024 and m or M = xx * 1024 * 1024
> > +*/
/* Add a human touch to the LAR size by allowing suffixes:
* XX[KkMm] where k = XX * 1024 and m or M = xx * 1024 * 1024
*/
> > +
> > +static void parse_larsize(char *str)
static void parse_larsize(const char *str)
> > +{
> > + char *p = NULL;
> > + unsigned int size = strtoul(str, &p, 0);
> > +
> > + if (p != NULL) {
> > + if (*p == 'k' || *p == 'K')
> > + size *= 1024;
> > + else if (*p == 'm' || *p == 'M')
> > + size *= (1024 * 1024);
> > + else {
> > + fprintf(stderr, "Unknown LAR size suffix %c\n", *p);
> > + exit(1);
> > + }
> > + }
> > +
> > + larsize = size;
> > +}
Please fix the coding style (TABs instead of spaces, for example).
Uwe.
--
http://www.hermann-uwe.de | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070711/c3c77c6b/attachment.sig>
More information about the coreboot
mailing list