diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-05-31 16:26:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 17:49:27 -0700 |
commit | 725fe002d315c2501c110b7245d3eb4f4535f4d6 (patch) | |
tree | c68759e4765673eb1f28e220edea40d84d9ff744 /lib/extable.c | |
parent | d84970bbaf9a09b3fc60c18ee6d59bc9cb4c3b8a (diff) | |
download | op-kernel-dev-725fe002d315c2501c110b7245d3eb4f4535f4d6.zip op-kernel-dev-725fe002d315c2501c110b7245d3eb4f4535f4d6.tar.gz |
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 <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/extable.c')
0 files changed, 0 insertions, 0 deletions