]> 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>
Wed, 12 Oct 2011 06:32:24 +0000 (17:32 +1100)
commit96da26a85c614d4888007b7bc6e4dc3553a1035e
treeaca58b2298f5ee8974cdde3d732785503d364075
parenta3ef300e4f0f89664331e60fa46212933b646298
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