mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-20 14:16:02 +00:00
![Alexey Dobriyan](/assets/img/avatar_default.png)
Currently termination logic (\0 or \n\0) is hardcoded in _kstrtoull(), avoid that for code reuse between kstrto*() and simple_strtoull(). Essentially, make them different only in termination logic. simple_strtoull() (and scanf(), BTW) ignores integer overflow, that's a bug we currently don't have guts to fix, making KSTRTOX_OVERFLOW hack necessary. Almost forgot: patch shrinks code size by about ~80 bytes on x86_64. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 lines
254 B
C
8 lines
254 B
C
#ifndef _LIB_KSTRTOX_H
|
|
#define _LIB_KSTRTOX_H
|
|
|
|
#define KSTRTOX_OVERFLOW (1U << 31)
|
|
const char *_parse_integer_fixup_radix(const char *s, unsigned int *base);
|
|
unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long *res);
|
|
|
|
#endif
|