Re: [PATCH] docs: add extra integer types to printk-formats

From: Andy Shevchenko
Date: Sun Mar 03 2019 - 15:10:23 EST


On Sun, Mar 03, 2019 at 12:36:47PM +0000, Louis Taylor wrote:
> A few commonly used integer types were absent from this table, so add
> them.

I'm not against the patch, but isn't obvious by reading POSIX and / or man
printf(3)?

> Link: https://github.com/ClangBuiltLinux/linux/issues/378

Thanks for the link.

It's interesting to see how compiler type mindset applies to fixing drivers and
hardware related code...

> Suggested-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> Signed-off-by: Louis Taylor <louis@xxxxxxxxxx>
> ---
> Documentation/core-api/printk-formats.rst | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
> index a7fae4538946..6f08b1b6240a 100644
> --- a/Documentation/core-api/printk-formats.rst
> +++ b/Documentation/core-api/printk-formats.rst
> @@ -19,8 +19,16 @@ Integer types
> unsigned long %lu or %lx
> long long %lld or %llx
> unsigned long long %llu or %llx
> + short int %hd or %hx
> + unsigned short int %hu or %hx
> + char %hhd or %hhx
> + unsigned char %hhu or %hhx
> size_t %zu or %zx
> ssize_t %zd or %zx
> + s8 %hhd or %hhx
> + u8 %hhu or %hhx
> + s16 %hd or %hx
> + u16 %hu or %hx
> s32 %d or %x
> u32 %u or %x
> s64 %lld or %llx
> --
> 2.20.1
>

--
With Best Regards,
Andy Shevchenko