]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib/kstrtox: common code between kstrto*() and simple_strto*() functions
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 5 Oct 2011 00:43:35 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 11 Oct 2011 08:44:05 +0000 (19:44 +1100)
commit4d5d9bfc20cb07b946dcaf3b824390d8a45612c0
tree95fc6c312891c8d67f2155c85ada326171433c98
parent5b4bd1a450add9d4d05adabed55cb0dba57713c0
lib/kstrtox: common code between kstrto*() and simple_strto*() functions

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>
lib/kstrtox.c
lib/kstrtox.h [new file with mode: 0644]
lib/vsprintf.c