From: Grant Likely Date: Thu, 31 May 2012 23:26:08 +0000 (-0700) Subject: vsprintf: correctly handle width when '#' flag used in %#p format X-Git-Tag: v3.5-rc1~21^2~67 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=725fe002d315c2501c110b7245d3eb4f4535f4d6;p=pandora-kernel.git vsprintf: correctly handle width when '#' flag used in %#p format The '%p' output of the kernel's vsprintf() uses spec.field_width to determine how many digits to output based on 2 * sizeof(void*) so that all digits of a pointer are shown. ie. a pointer will be output as "001A2B3C" instead of "1A2B3C". However, if the '#' flag is used in the format (%#p), then the code doesn't take into account the width of the '0x' prefix and will end up outputing "0x1A2B3C" instead of "0x001A2B3C". This patch reworks the "pointer()" format hook to include 2 characters for the '0x' prefix if the '#' flag is included. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Grant Likely Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed