[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <496BFAE9-8BCE-4617-BEA6-71CD5F03B37D@live.com>
Date: Fri, 14 Mar 2025 03:49:48 +0000
From: Aditya Garg <gargaditya08@...e.com>
To: Petr Mladek <pmladek@...e.com>, "keescook@...omium.org"
<keescook@...omium.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Sven Peter <sven@...npeter.dev>, Thomas Zimmermann <tzimmermann@...e.de>,
Aun-Ali Zaidi <admin@...eit.net>, Maxime Ripard <mripard@...nel.org>,
"airlied@...hat.com" <airlied@...hat.com>, Simona Vetter <simona@...ll.ch>,
Steven Rostedt <rostedt@...dmis.org>, Rasmus Villemoes
<linux@...musvillemoes.dk>, Sergey Senozhatsky <senozhatsky@...omium.org>,
Jonathan Corbet <corbet@....net>, Andrew Morton <akpm@...ux-foundation.org>,
"apw@...onical.com" <apw@...onical.com>, "joe@...ches.com" <joe@...ches.com>,
"dwaipayanray1@...il.com" <dwaipayanray1@...il.com>,
"lukas.bulwahn@...il.com" <lukas.bulwahn@...il.com>, Alyssa Rosenzweig
<alyssa@...enzweig.io>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>, Hector Martin
<marcan@...can.st>, Asahi Linux Mailing List <asahi@...ts.linux.dev>
Subject: Re: [PATCH v2 1/2] lib/vsprintf: Add support for generic FourCCs by
extending %p4cc
> On 13 Mar 2025, at 4:49 PM, Aditya Garg <gargaditya08@...e.com> wrote:
>
> From: Hector Martin <marcan@...can.st>
>
> %p4cc is designed for DRM/V4L2 FourCCs with their specific quirks, but
> it's useful to be able to print generic 4-character codes formatted as
> an integer. Extend it to add format specifiers for printing generic
> 32-bit FourCCs with various endian semantics:
>
> %p4ch Host byte order
> %p4cn Network byte order
> %p4cl Little-endian
> %p4cb Big-endian
>
> The endianness determines how bytes are interpreted as a u32, and the
> FourCC is then always printed MSByte-first (this is the opposite of
> V4L/DRM FourCCs). This covers most practical cases, e.g. %p4cn would
> allow printing LSByte-first FourCCs stored in host endian order
> (other than the hex form being in character order, not the integer
> value).
>
> Acked-by: Rasmus Villemoes <linux@...musvillemoes.dk>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Reviewed-by: Petr Mladek <pmladek@...e.com>
> Tested-by: Petr Mladek <pmladek@...e.com>
> Signed-off-by: Hector Martin <marcan@...can.st>
> Signed-off-by: Aditya Garg <gargaditya08@...e.com>
> ---
> Documentation/core-api/printk-formats.rst | 32 +++++++++++++++++++++
> lib/vsprintf.c | 35 +++++++++++++++++++----
> scripts/checkpatch.pl | 2 +-
> 3 files changed, 62 insertions(+), 7 deletions(-)
FWIW, the test_printf.c part, as suggested by Petr, which was removed in v2, has been sent to Kees here:
https://lore.kernel.org/lkml/4378DDFE-3263-497A-8364-433DC1984FEE@live.com/T/#u
The series should be good to merge now.
Powered by blists - more mailing lists