Messages in this thread | | | From | Rasmus Villemoes <> | Subject | Re: [PATCH v2] devpts: allow mounting with uid/gid of uint32_t | Date | Wed, 19 Aug 2015 10:34:43 +0200 |
| |
On Wed, Aug 19 2015, Andrew Morton <akpm@linux-foundation.org> wrote:
> > whoa, wait, I was looking at the -mm tree which changes kstrtouint(): > > static inline int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res) > { > return parse_integer(s, base | PARSE_INTEGER_NEWLINE, res); > } > > and > > * Return number of characters parsed or -E. > ... > */ > #define parse_integer(s, base, val) \ > > > Alexey, doesn't this mean that code which does > > if (kstrtouint(...)) > return -EFOO; > > will break?
No, because PARSE_INTEGER_NEWLINE means more than just accepting a trailing newline. It also requires the entire string to be consumed, and changes the return semantics.
I suggested splitting those three things into separate flags and letting PARSE_INTEGER_KSTRTOX be a shorthand for those.
<http://thread.gmane.org/gmane.linux.kernel/1949066/focus=1949239>
Rasmus
| |