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

2015-07-09 Thread Alexey Dobriyan
On Thu, Jul 09, 2015 at 12:28:41PM -0700, Andrew Morton wrote: > On Fri, 8 May 2015 21:30:29 +0300 Alexey Dobriyan 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

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

2015-07-09 Thread Andrew Morton
On Fri, 8 May 2015 21:30:29 +0300 Alexey Dobriyan wrote: > Enter parse_integer(). > > int parse_integer(const char *s, unsigned int base, T *val); OK, I grabbed these. Let's see how it goes. Were these patches still up to date? Presumably we'd benefit from a checkpatch rule to alert pe

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

2015-05-13 Thread Alexey Dobriyan
[Answering to Noel Grandin, gmane sent email to list only] > > int parse_integer(const char *s, unsigned int base, T *val); > > > > I suspect splitting this into > parse_signed_int > and > parse_unsigned_int > (or some other equivalent names) > will make the call-sites a lot easier to rea

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

2015-05-10 Thread Noel Grandin
> int parse_integer(const char *s, unsigned int base, T *val); > I suspect splitting this into parse_signed_int and parse_unsigned_int (or some other equivalent names) will make the call-sites a lot easier to read. -- To unsubscribe from this list: send the line "unsubscribe lin

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

2015-05-10 Thread Alexey Dobriyan
On Fri, May 08, 2015 at 01:46:46PM -0700, Andrew Morton wrote: > On Fri, 8 May 2015 21:30:29 +0300 Alexey Dobriyan wrote: > > > kstrto*() and kstrto*_from_user() family of functions were added > > to help with parsing one integer written as string to proc/sysfs/debugfs > > files. But they have a

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

2015-05-08 Thread Rasmus Villemoes
On Fri, May 08 2015, Andrew Morton wrote: > My overall reaction to this is "oh god, not again". Is it really worth > it? I think it is, if it's done right. The problem is to get consensus on what right means, but I think Alexey's approach is ok. The huge macro may be ugly, but it puts the uglin

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

2015-05-08 Thread Andrew Morton
On Fri, 8 May 2015 21:30:29 +0300 Alexey Dobriyan wrote: > kstrto*() and kstrto*_from_user() family of functions were added > to help with parsing one integer written as string to proc/sysfs/debugfs > files. But they have a limitation: string passed must end with \0 or \n\0. > There are enough pl

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

2015-05-08 Thread Alexey Dobriyan
kstrto*() and kstrto*_from_user() family of functions were added to help with parsing one integer written as string to proc/sysfs/debugfs files. But they have a limitation: string passed must end with \0 or \n\0. There are enough places where kstrto*() functions can't be used because of this limita