]> 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, 5 Oct 2011 07:50:59 +0000 (18:50 +1100)
commit846125137543a08519d45223584aaa6171da5f73
treed7b71aed5aed034cce13b31590e3ba05aeb65efa
parent7e25af777760a55ae94f3acb1fdb3858213a2f76
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