• Andy Shevchenko's avatar
    lib/vsprintf: refactor duplicate code to special_hex_number() · 3cab1e71
    Andy Shevchenko authored
    special_hex_number() is a helper to print a fixed size type in a hex
    format with '0x' prefix, zero padding, and small letters.  In the module
    we have already several copies of such code.  Consolidate them under
    special_hex_number() helper.
    
    There are couple of differences though.
    
    It seems nobody cared about the output in case of CONFIG_KALLSYMS=n,
    when printing symbol address, because the asked field width is not
    enough to care last 2 characters in the string represantation of the
    pointer.  Fixed here.
    
    The %pNF specifier used to be allowed with a specific field width,
    though there is neither any user of it nor mention the possibility in
    the documentation.
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Cc: Joe Perches <joe@perches.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3cab1e71
vsprintf.c 63.6 KB