Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-21 Thread Aditya Garg
> Does this look good now? Made orig a union. Wait, it's messier. Maybe declare data type of val separately in each case? > > char *fourcc_string(char *buf, char *end, const u32 *fourcc, const char *fmt, > struct printf_spec spec) > { > char output[sizeof("0123 little-endian (0x01234567)")]; >

Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-21 Thread andriy.shevche...@linux.intel.com
On Fri, Feb 21, 2025 at 08:06:51PM +, Aditya Garg wrote: > > > Does this look good now? Made orig a union. > > Wait, it's messier. Maybe declare data type of val separately in each case? Yes, this sounds better. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-21 Thread Aditya Garg
> On 21 Feb 2025, at 8:57 PM, andriy.shevche...@linux.intel.com wrote: > > On Thu, Feb 20, 2025 at 04:39:23PM +, Aditya Garg wrote: >> From: Hector Martin >> >> %p4cc is designed for DRM/V4L2 FOURCCs with their specific quirks, but >> it's useful to be able to print generic 4-character cod

Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-21 Thread andriy.shevche...@linux.intel.com
On Thu, Feb 20, 2025 at 04:39:23PM +, Aditya Garg wrote: > From: Hector Martin > > %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 gene

Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-21 Thread Aditya Garg
Hi > >> >> diff --git a/lib/test_printf.c b/lib/test_printf.c >> index 59dbe4f9a..ee860327e 100644 >> --- a/lib/test_printf.c >> +++ b/lib/test_printf.c >> @@ -776,21 +776,46 @@ static void __init fwnode_pointer(void) >> software_node_unregister_node_group(group); >> } >> >> +struct fourcc_stru

Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-21 Thread Rasmus Villemoes
On Thu, Feb 20 2025, Aditya Garg wrote: > v2 -> Add this patch > Documentation/core-api/printk-formats.rst | 32 +++ > lib/test_printf.c | 39 +++ > lib/vsprintf.c| 38 ++ Yay! Thanks for

[PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

2025-02-20 Thread Aditya Garg
From: Hector Martin %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-endian