docs: printk-formats: Fix hex printing of signed values

The commit cbacb5ab0a ("docs: printk-formats: Stop encouraging use of
unnecessary %h[xudi] and %hh[xudi]") obviously missed the point of sign
promotion for the signed values lesser than int. In such case %x prints
not the same as %h[h]x. Restore back those specifiers for the signed hex
cases.

Fixes: cbacb5ab0a ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230703145839.14248-1-andriy.shevchenko@linux.intel.com
This commit is contained in:
Andy Shevchenko 2023-07-03 17:58:38 +03:00 committed by Petr Mladek
parent 7ec85f3e08
commit 46d57a7a8e
1 changed files with 4 additions and 4 deletions

View File

@ -15,9 +15,9 @@ Integer types
If variable is of Type, use printk format specifier:
------------------------------------------------------------
char %d or %x
char %d or %hhx
unsigned char %u or %x
short int %d or %x
short int %d or %hx
unsigned short int %u or %x
int %d or %x
unsigned int %u or %x
@ -27,9 +27,9 @@ Integer types
unsigned long long %llu or %llx
size_t %zu or %zx
ssize_t %zd or %zx
s8 %d or %x
s8 %d or %hhx
u8 %u or %x
s16 %d or %x
s16 %d or %hx
u16 %u or %x
s32 %d or %x
u32 %u or %x