Re: [PATCH 02/12] Add parse_integer() (replacement for simple_strto*())

From: Alexey Dobriyan
Date: Fri Jul 10 2015 - 02:47:00 EST


On Thu, Jul 09, 2015 at 12:28:41PM -0700, Andrew Morton wrote:
> On Fri, 8 May 2015 21:30:29 +0300 Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
>
> > Enter parse_integer().
> >
> > int parse_integer(const char *s, unsigned int base, T *val);
>
> OK, I grabbed these.

Thanks! Just to note, first patch (accept "-0") is independent and
can be sent at any time.

> Let's see how it goes. Were these patches still up to date?

Yes, kstrto*(), scanf() didn't change since when this was sent.

> Presumably we'd benefit from a checkpatch rule to alert people to the
> new regime. Can you please suggest what such a rule should do?

It should say to switch from simple_strto*() to one of the 4 officially
sanctioned integer conversion routines: parse_integer(), kstrto*(),
kstrto*_from_user(), sscanf(). I'll send a patch.

> The macros in lib/test-parse-integer.c hurt my brain.

Well, yes, but the only interesting thing there are test tables.

Alexey
--
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/