summaryrefslogtreecommitdiffstats
path: root/lib/bcd.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2015-04-16 01:17:05 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-16 01:35:23 +0200
commite26c12c777118d65aeb97eb1651338e7decae80e (patch)
tree55300d96e94c3e9efdaf434b8473ccc02536ba7d /lib/bcd.c
parentlib/vsprintf.c: eliminate some branches (diff)
downloadlinux-e26c12c777118d65aeb97eb1651338e7decae80e.tar.xz
linux-e26c12c777118d65aeb97eb1651338e7decae80e.zip
lib/vsprintf.c: reduce stack use in number()
At least since the initial git commit, when base was passed as a separate parameter, number() has only been called with bases 8, 10 and 16. I'm guessing that 66 was to accommodate 64 0/1, a sign and a '\0', but the buffer is only used for the actual digits. Octal digits carry 3 bits of information, so 24 is enough. Spell that 3*sizeof(num) so one less place needs to be changed should long long ever be 128 bits. Also remove the commented-out code that would handle an arbitrary base. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/bcd.c')
0 files changed, 0 insertions, 0 deletions