]> 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>
Thu, 6 Oct 2011 05:59:59 +0000 (16:59 +1100)
commitae02aeb173630a4769bd83e8db14325a363a127f
tree968ea6021c340f3ab5985ebba86be06a223274c3
parent5d93fb20ab3ec95552a13b83c32661aef20cc25d
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