]> 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>
Fri, 14 Oct 2011 06:34:17 +0000 (17:34 +1100)
commit545b7353672382d0676cb655c756734c2e68f712
treed939706cef2cb070b47c2bd4145cb86d06cf964c
parent5c02ecc428772158fb88f54b2f7ad1138cbb4cdb
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