Re: [RFC][PATCH] x86: Allow early_printk to use console style param like 115200n8

From: Steven Rostedt
Date: Sun Jul 05 2015 - 04:32:45 EST


On Sat, 4 Jul 2015 13:03:59 +0200
Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> So why not revert to the known-working simple_strtoul()? I don't see this as an
> improvement:
>
> > + /*
> > + * In case the input is like console with text after the baud
> > + * rate. e.g. 115200n8. kstrtoul() will error on such input.
> > + */
> > + for (p = s; *p && isdigit(*p); p++)
> > + ;
> > + *p = 0;
> > +
> > if (kstrtoul(s, 0, &baud) < 0 || baud == 0)
> > baud = DEFAULT_BAUD;
>
>
> Over the old:
>
> baud = simple_strtoul(s, &e, 0);
>

That was what I actually did first, but then saw this:

* Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
* Used as a replacement for the obsolete simple_strtoull. Return code must
* be checked.

in lib/kstrtox.c and thought that it seems that we are trying to phase
out that function. Personally, I prefer keeping it for instances like
this.

So by all means, put back the simple_strtoul(); I would like that too.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/