From: Rasmus Villemoes Date: Wed, 15 Apr 2015 23:17:05 +0000 (-0700) Subject: lib/vsprintf.c: reduce stack use in number() X-Git-Tag: omap-for-v4.1/fixes-rc1~128^2~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e26c12c777118d65aeb97eb1651338e7decae80e;p=pandora-kernel.git 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 Cc: Peter Zijlstra Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed