mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-10 08:41:03 -04:00
lib: vsprintf: use _parse_integer() instead of _parse_integer_limit()
Use _parse_integer() that allows optional arguments to be explicitly initialised. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
committed by
Jonathan Cameron
parent
ce0d638054
commit
b482908f8c
@@ -12,6 +12,9 @@ unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned lon
|
||||
#define _parse_integer0(s, base, res, ...) \
|
||||
_parse_integer_limit(s, base, res, INT_MAX)
|
||||
|
||||
#define _parse_integer1(s, base, res, max_chars, ...) \
|
||||
_parse_integer_limit(s, base, res, max_chars)
|
||||
|
||||
#define _parse_integer(s, base, res, ...) \
|
||||
CONCATENATE(_parse_integer, COUNT_ARGS(__VA_ARGS__))(s, base, res, __VA_ARGS__)
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ static unsigned long long simple_strntoull(const char *startp, char **endp, unsi
|
||||
cp = _parse_integer_fixup_radix(startp, &base);
|
||||
prefix_chars = cp - startp;
|
||||
if (prefix_chars < max_chars) {
|
||||
rv = _parse_integer_limit(cp, base, &result, max_chars - prefix_chars);
|
||||
rv = _parse_integer(cp, base, &result, max_chars - prefix_chars);
|
||||
/* FIXME */
|
||||
cp += (rv & ~KSTRTOX_OVERFLOW);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user