* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
@ 2025-04-28 13:02 ` Aditya Garg
2025-04-28 13:33 ` Geert Uytterhoeven
` (5 subsequent siblings)
6 siblings, 0 replies; 17+ messages in thread
From: Aditya Garg @ 2025-04-28 13:02 UTC (permalink / raw)
To: Petr Mladek, alyssa, Andy Shevchenko, Sven Peter,
Thomas Zimmermann, Aun-Ali Zaidi, Maxime Ripard, airlied,
Simona Vetter, Steven Rostedt, Rasmus Villemoes,
Sergey Senozhatsky, Jonathan Corbet, Andrew Morton, apw, joe,
dwaipayanray1, lukas.bulwahn, Kees Cook, tamird
Cc: Linux Kernel Mailing List, dri-devel, linux-doc, Hector Martin,
Asahi Linux Mailing List, Geert Uytterhoeven
On 28-04-2025 06:01 pm, Petr Mladek wrote:
> The generic FourCC format always prints the data using the big endian
> order. It is generic because it allows to read the data using a custom
> ordering.
>
> The current code uses "n" for reading data in the reverse host ordering.
> It makes the 4 variants [hnbl] consistent with the generic printing
> of IPv4 addresses.
>
> Unfortunately, it creates confusion on big endian systems. For example,
> it shows the data &(u32)0x67503030 as
>
> %p4cn 00Pg (0x30305067)
>
> But people expect that the ordering stays the same. The network ordering
> is a big-endian ordering.
>
> The problem is that the semantic is not the same. The modifiers affect
> the output ordering of IPv4 addresses while they affect the reading order
> in case of FourCC code.
>
> Avoid the confusion by replacing the "n" modifier with "hR", aka
> reverse host ordering. It is inspired by the existing %p[mM]R printf
> format.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Closes: https://lore.kernel.org/r/CAMuHMdV9tX=TG7E_CrSF=2PY206tXf+_yYRuacG48EWEtJLo-Q@mail.gmail.com
> Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Aditya Garg <gargaditya08@live.com>
> ---
> Hi,
>
> I am sending this as a proper patch. It would be nice to queue it
> together with the other patches adding the generic printf modifiers.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
2025-04-28 13:02 ` Aditya Garg
@ 2025-04-28 13:33 ` Geert Uytterhoeven
2025-04-28 17:00 ` Alyssa Rosenzweig
` (4 subsequent siblings)
6 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2025-04-28 13:33 UTC (permalink / raw)
To: Petr Mladek
Cc: alyssa, Andy Shevchenko, Sven Peter, Thomas Zimmermann,
Aun-Ali Zaidi, Maxime Ripard, airlied, Simona Vetter,
Steven Rostedt, Rasmus Villemoes, Sergey Senozhatsky,
Jonathan Corbet, Andrew Morton, apw, joe, dwaipayanray1,
lukas.bulwahn, Kees Cook, tamird, Aditya Garg,
Linux Kernel Mailing List, dri-devel, linux-doc, Hector Martin,
Asahi Linux Mailing List
On Mon, 28 Apr 2025 at 14:31, Petr Mladek <pmladek@suse.com> wrote:
> The generic FourCC format always prints the data using the big endian
> order. It is generic because it allows to read the data using a custom
> ordering.
>
> The current code uses "n" for reading data in the reverse host ordering.
> It makes the 4 variants [hnbl] consistent with the generic printing
> of IPv4 addresses.
>
> Unfortunately, it creates confusion on big endian systems. For example,
> it shows the data &(u32)0x67503030 as
>
> %p4cn 00Pg (0x30305067)
>
> But people expect that the ordering stays the same. The network ordering
> is a big-endian ordering.
>
> The problem is that the semantic is not the same. The modifiers affect
> the output ordering of IPv4 addresses while they affect the reading order
> in case of FourCC code.
>
> Avoid the confusion by replacing the "n" modifier with "hR", aka
> reverse host ordering. It is inspired by the existing %p[mM]R printf
> format.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Closes: https://lore.kernel.org/r/CAMuHMdV9tX=TG7E_CrSF=2PY206tXf+_yYRuacG48EWEtJLo-Q@mail.gmail.com
> Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
2025-04-28 13:02 ` Aditya Garg
2025-04-28 13:33 ` Geert Uytterhoeven
@ 2025-04-28 17:00 ` Alyssa Rosenzweig
2025-04-28 17:08 ` Aditya Garg
2025-04-29 13:53 ` Aditya Garg
` (3 subsequent siblings)
6 siblings, 1 reply; 17+ messages in thread
From: Alyssa Rosenzweig @ 2025-04-28 17:00 UTC (permalink / raw)
To: Petr Mladek
Cc: Andy Shevchenko, Sven Peter, Thomas Zimmermann, Aun-Ali Zaidi,
Maxime Ripard, airlied, Simona Vetter, Steven Rostedt,
Rasmus Villemoes, Sergey Senozhatsky, Jonathan Corbet,
Andrew Morton, apw, joe, dwaipayanray1, lukas.bulwahn, Kees Cook,
tamird, Aditya Garg, Linux Kernel Mailing List, dri-devel,
linux-doc, Hector Martin, Asahi Linux Mailing List,
Geert Uytterhoeven
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Since the other patches went thru drm-misc-next, I guess this should
too?
Le Mon , Apr 28, 2025 at 02:31:32PM +0200, Petr Mladek a écrit :
> The generic FourCC format always prints the data using the big endian
> order. It is generic because it allows to read the data using a custom
> ordering.
>
> The current code uses "n" for reading data in the reverse host ordering.
> It makes the 4 variants [hnbl] consistent with the generic printing
> of IPv4 addresses.
>
> Unfortunately, it creates confusion on big endian systems. For example,
> it shows the data &(u32)0x67503030 as
>
> %p4cn 00Pg (0x30305067)
>
> But people expect that the ordering stays the same. The network ordering
> is a big-endian ordering.
>
> The problem is that the semantic is not the same. The modifiers affect
> the output ordering of IPv4 addresses while they affect the reading order
> in case of FourCC code.
>
> Avoid the confusion by replacing the "n" modifier with "hR", aka
> reverse host ordering. It is inspired by the existing %p[mM]R printf
> format.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Closes: https://lore.kernel.org/r/CAMuHMdV9tX=TG7E_CrSF=2PY206tXf+_yYRuacG48EWEtJLo-Q@mail.gmail.com
> Signed-off-by: Petr Mladek <pmladek@suse.com>
> ---
> Hi,
>
> I am sending this as a proper patch. It would be nice to queue it
> together with the other patches adding the generic printf modifiers.
>
> Best Regards,
> Petr
> ---
> Documentation/core-api/printk-formats.rst | 10 +++++-----
> lib/tests/printf_kunit.c | 4 ++--
> lib/vsprintf.c | 11 ++++++++---
> 3 files changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
> index 125fd0397510..f531873bb3c9 100644
> --- a/Documentation/core-api/printk-formats.rst
> +++ b/Documentation/core-api/printk-formats.rst
> @@ -652,7 +652,7 @@ Generic FourCC code
> -------------------
>
> ::
> - %p4c[hnlb] gP00 (0x67503030)
> + %p4c[h[R]lb] gP00 (0x67503030)
>
> Print a generic FourCC code, as both ASCII characters and its numerical
> value as hexadecimal.
> @@ -660,23 +660,23 @@ value as hexadecimal.
> The generic FourCC code is always printed in the big-endian format,
> the most significant byte first. This is the opposite of V4L/DRM FourCCs.
>
> -The additional ``h``, ``n``, ``l``, and ``b`` specifiers define what
> +The additional ``h``, ``hR``, ``l``, and ``b`` specifiers define what
> endianness is used to load the stored bytes. The data might be interpreted
> -using the host byte order, network byte order, little-endian, or big-endian.
> +using the host, reversed host byte order, little-endian, or big-endian.
>
> Passed by reference.
>
> Examples for a little-endian machine, given &(u32)0x67503030::
>
> %p4ch gP00 (0x67503030)
> - %p4cn 00Pg (0x30305067)
> + %p4chR 00Pg (0x30305067)
> %p4cl gP00 (0x67503030)
> %p4cb 00Pg (0x30305067)
>
> Examples for a big-endian machine, given &(u32)0x67503030::
>
> %p4ch gP00 (0x67503030)
> - %p4cn 00Pg (0x30305067)
> + %p4chR 00Pg (0x30305067)
> %p4cl 00Pg (0x30305067)
> %p4cb gP00 (0x67503030)
>
> diff --git a/lib/tests/printf_kunit.c b/lib/tests/printf_kunit.c
> index b1fa0dcea52f..bc54cca2d7a6 100644
> --- a/lib/tests/printf_kunit.c
> +++ b/lib/tests/printf_kunit.c
> @@ -726,7 +726,7 @@ static void fourcc_pointer(struct kunit *kunittest)
> static const struct fourcc_struct try_ch[] = {
> { 0x41424344, "ABCD (0x41424344)", },
> };
> - static const struct fourcc_struct try_cn[] = {
> + static const struct fourcc_struct try_chR[] = {
> { 0x41424344, "DCBA (0x44434241)", },
> };
> static const struct fourcc_struct try_cl[] = {
> @@ -738,7 +738,7 @@ static void fourcc_pointer(struct kunit *kunittest)
>
> fourcc_pointer_test(kunittest, try_cc, ARRAY_SIZE(try_cc), "%p4cc");
> fourcc_pointer_test(kunittest, try_ch, ARRAY_SIZE(try_ch), "%p4ch");
> - fourcc_pointer_test(kunittest, try_cn, ARRAY_SIZE(try_cn), "%p4cn");
> + fourcc_pointer_test(kunittest, try_chR, ARRAY_SIZE(try_chR), "%p4chR");
> fourcc_pointer_test(kunittest, try_cl, ARRAY_SIZE(try_cl), "%p4cl");
> fourcc_pointer_test(kunittest, try_cb, ARRAY_SIZE(try_cb), "%p4cb");
> }
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 2c5de4216415..34587b2dbdb1 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -1804,9 +1804,8 @@ char *fourcc_string(char *buf, char *end, const u32 *fourcc,
> orig = get_unaligned(fourcc);
> switch (fmt[2]) {
> case 'h':
> - break;
> - case 'n':
> - orig = swab32(orig);
> + if (fmt[3] == 'R')
> + orig = swab32(orig);
> break;
> case 'l':
> orig = (__force u32)cpu_to_le32(orig);
> @@ -2396,6 +2395,12 @@ early_param("no_hash_pointers", no_hash_pointers_enable);
> * read the documentation (path below) first.
> * - 'NF' For a netdev_features_t
> * - '4cc' V4L2 or DRM FourCC code, with endianness and raw numerical value.
> + * - '4c[h[R]lb]' For generic FourCC code with raw numerical value. Both are
> + * displayed in the big-endian format. This is the opposite of V4L2 or
> + * DRM FourCCs.
> + * The additional specifiers define what endianness is used to load
> + * the stored bytes. The data might be interpreted using the host,
> + * reversed host byte order, little-endian, or big-endian.
> * - 'h[CDN]' For a variable-length buffer, it prints it as a hex string with
> * a certain separator (' ' by default):
> * C colon
> --
> 2.49.0
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 17:00 ` Alyssa Rosenzweig
@ 2025-04-28 17:08 ` Aditya Garg
2025-04-29 11:39 ` Petr Mladek
0 siblings, 1 reply; 17+ messages in thread
From: Aditya Garg @ 2025-04-28 17:08 UTC (permalink / raw)
To: Alyssa Rosenzweig, Petr Mladek
Cc: Andy Shevchenko, Sven Peter, Thomas Zimmermann, Aun-Ali Zaidi,
Maxime Ripard, airlied, Simona Vetter, Steven Rostedt,
Rasmus Villemoes, Sergey Senozhatsky, Jonathan Corbet,
Andrew Morton, apw, joe, dwaipayanray1, lukas.bulwahn, Kees Cook,
tamird, Linux Kernel Mailing List, dri-devel, linux-doc,
Hector Martin, Asahi Linux Mailing List, Geert Uytterhoeven
On 28-04-2025 10:30 pm, Alyssa Rosenzweig wrote:
> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
>
> Since the other patches went thru drm-misc-next, I guess this should
> too?
I think yes.
>
>
> Le Mon , Apr 28, 2025 at 02:31:32PM +0200, Petr Mladek a écrit :
>> The generic FourCC format always prints the data using the big endian
>> order. It is generic because it allows to read the data using a custom
>> ordering.
>>
>> The current code uses "n" for reading data in the reverse host ordering.
>> It makes the 4 variants [hnbl] consistent with the generic printing
>> of IPv4 addresses.
>>
>> Unfortunately, it creates confusion on big endian systems. For example,
>> it shows the data &(u32)0x67503030 as
>>
>> %p4cn 00Pg (0x30305067)
>>
>> But people expect that the ordering stays the same. The network ordering
>> is a big-endian ordering.
>>
>> The problem is that the semantic is not the same. The modifiers affect
>> the output ordering of IPv4 addresses while they affect the reading order
>> in case of FourCC code.
>>
>> Avoid the confusion by replacing the "n" modifier with "hR", aka
>> reverse host ordering. It is inspired by the existing %p[mM]R printf
>> format.
>>
>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Closes: https://lore.kernel.org/r/CAMuHMdV9tX=TG7E_CrSF=2PY206tXf+_yYRuacG48EWEtJLo-Q@mail.gmail.com
>> Signed-off-by: Petr Mladek <pmladek@suse.com>
>> ---
>> Hi,
>>
>> I am sending this as a proper patch. It would be nice to queue it
>> together with the other patches adding the generic printf modifiers.
Atleast thats what this says.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 17:08 ` Aditya Garg
@ 2025-04-29 11:39 ` Petr Mladek
2025-04-29 13:27 ` Alyssa Rosenzweig
0 siblings, 1 reply; 17+ messages in thread
From: Petr Mladek @ 2025-04-29 11:39 UTC (permalink / raw)
To: Aditya Garg
Cc: Alyssa Rosenzweig, Andy Shevchenko, Sven Peter, Thomas Zimmermann,
Aun-Ali Zaidi, Maxime Ripard, airlied, Simona Vetter,
Steven Rostedt, Rasmus Villemoes, Sergey Senozhatsky,
Jonathan Corbet, Andrew Morton, apw, joe, dwaipayanray1,
lukas.bulwahn, Kees Cook, tamird, Linux Kernel Mailing List,
dri-devel, linux-doc, Hector Martin, Asahi Linux Mailing List,
Geert Uytterhoeven
On Mon 2025-04-28 22:38:13, Aditya Garg wrote:
>
>
> On 28-04-2025 10:30 pm, Alyssa Rosenzweig wrote:
> > Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> >
> > Since the other patches went thru drm-misc-next, I guess this should
> > too?
>
> I think yes.
Yes, it would be ideal to add this to drm-misc-next as well.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-29 11:39 ` Petr Mladek
@ 2025-04-29 13:27 ` Alyssa Rosenzweig
0 siblings, 0 replies; 17+ messages in thread
From: Alyssa Rosenzweig @ 2025-04-29 13:27 UTC (permalink / raw)
To: Petr Mladek
Cc: Aditya Garg, Andy Shevchenko, Sven Peter, Thomas Zimmermann,
Aun-Ali Zaidi, Maxime Ripard, airlied, Simona Vetter,
Steven Rostedt, Rasmus Villemoes, Sergey Senozhatsky,
Jonathan Corbet, Andrew Morton, apw, joe, dwaipayanray1,
lukas.bulwahn, Kees Cook, tamird, Linux Kernel Mailing List,
dri-devel, linux-doc, Hector Martin, Asahi Linux Mailing List,
Geert Uytterhoeven
Le Tue, Apr 29, 2025 at 01:39:43PM +0200, Petr Mladek a écrit :
> On Mon 2025-04-28 22:38:13, Aditya Garg wrote:
> >
> >
> > On 28-04-2025 10:30 pm, Alyssa Rosenzweig wrote:
> > > Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> > >
> > > Since the other patches went thru drm-misc-next, I guess this should
> > > too?
> >
> > I think yes.
>
> Yes, it would be ideal to add this to drm-misc-next as well.
ok, will queue this
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
` (2 preceding siblings ...)
2025-04-28 17:00 ` Alyssa Rosenzweig
@ 2025-04-29 13:53 ` Aditya Garg
2025-04-29 13:53 ` Alyssa Rosenzweig
` (2 subsequent siblings)
6 siblings, 0 replies; 17+ messages in thread
From: Aditya Garg @ 2025-04-29 13:53 UTC (permalink / raw)
To: Petr Mladek, alyssa, Andy Shevchenko, Sven Peter,
Thomas Zimmermann, Aun-Ali Zaidi, Maxime Ripard, airlied,
Simona Vetter, Steven Rostedt, Rasmus Villemoes,
Sergey Senozhatsky, Jonathan Corbet, Andrew Morton, apw, joe,
dwaipayanray1, lukas.bulwahn, Kees Cook, tamird
Cc: Linux Kernel Mailing List, dri-devel, linux-doc, Hector Martin,
Asahi Linux Mailing List, Geert Uytterhoeven
Hi Petr
> The generic FourCC format always prints the data using the big endian
> order. It is generic because it allows to read the data using a custom
> ordering.
>
> The current code uses "n" for reading data in the reverse host ordering.
> It makes the 4 variants [hnbl] consistent with the generic printing
> of IPv4 addresses.
>
> Unfortunately, it creates confusion on big endian systems. For example,
> it shows the data &(u32)0x67503030 as
>
> %p4cn 00Pg (0x30305067)
>
> But people expect that the ordering stays the same. The network ordering
> is a big-endian ordering.
>
> The problem is that the semantic is not the same. The modifiers affect
> the output ordering of IPv4 addresses while they affect the reading order
> in case of FourCC code.
>
> Avoid the confusion by replacing the "n" modifier with "hR", aka
> reverse host ordering. It is inspired by the existing %p[mM]R printf
> format.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Closes: https://lore.kernel.org/r/CAMuHMdV9tX=TG7E_CrSF=2PY206tXf+_yYRuacG48EWEtJLo-Q@mail.gmail.com
> Signed-off-by: Petr Mladek <pmladek@suse.com>
> ---
I just realised you forgot to fix checkpatch.pl with your update:
https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/1938479b2720ebc05aab349c7dc0a53921ff7c87/scripts/checkpatch.pl#L6894
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
` (3 preceding siblings ...)
2025-04-29 13:53 ` Aditya Garg
@ 2025-04-29 13:53 ` Alyssa Rosenzweig
2025-04-29 16:07 ` [PATCH] checkpatch: remove %p4cn Aditya Garg
2025-04-29 17:50 ` [PATCH v2] checkpatch: remove %p4cn and add check for %p4chR Aditya Garg
6 siblings, 0 replies; 17+ messages in thread
From: Alyssa Rosenzweig @ 2025-04-29 13:53 UTC (permalink / raw)
To: Andy Shevchenko, Sven Peter, Thomas Zimmermann, Aun-Ali Zaidi,
Maxime Ripard, airlied, Simona Vetter, Steven Rostedt,
Rasmus Villemoes, Sergey Senozhatsky, Jonathan Corbet,
Andrew Morton, apw, joe, dwaipayanray1, lukas.bulwahn, Kees Cook,
tamird, Petr Mladek
Cc: Aditya Garg, Linux Kernel Mailing List, dri-devel, linux-doc,
Hector Martin, Asahi Linux Mailing List, Geert Uytterhoeven
On Mon, 28 Apr 2025 14:31:32 +0200, Petr Mladek wrote:
> The generic FourCC format always prints the data using the big endian
> order. It is generic because it allows to read the data using a custom
> ordering.
>
> The current code uses "n" for reading data in the reverse host ordering.
> It makes the 4 variants [hnbl] consistent with the generic printing
> of IPv4 addresses.
>
> [...]
Applied, thanks!
[1/1] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
commit: 37eed892cc5ff36aeee59bb78f6aa417a44030a9
Best regards,
--
Alyssa Rosenzweig <alyssa@rosenzweig.io>
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH] checkpatch: remove %p4cn
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
` (4 preceding siblings ...)
2025-04-29 13:53 ` Alyssa Rosenzweig
@ 2025-04-29 16:07 ` Aditya Garg
2025-04-29 17:35 ` Joe Perches
2025-04-30 13:49 ` [PATCH v3] " Aditya Garg
2025-04-29 17:50 ` [PATCH v2] checkpatch: remove %p4cn and add check for %p4chR Aditya Garg
6 siblings, 2 replies; 17+ messages in thread
From: Aditya Garg @ 2025-04-29 16:07 UTC (permalink / raw)
To: pmladek
Cc: admin, airlied, akpm, alyssa, andriy.shevchenko, apw, asahi,
corbet, dri-devel, dwaipayanray1, gargaditya08, geert, joe, kees,
linux-doc, linux-kernel, linux, lukas.bulwahn, marcan, mripard,
rostedt, senozhatsky, simona, sven, tamird, tzimmermann
%p4cn was recently removed and replaced by %p4chR in vsprintf. So,
remove the check for %p4cn from checkpatch.pl.
Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 44e233b6f..f79f0a085 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6891,7 +6891,7 @@ sub process {
($extension eq "f" &&
defined $qualifier && $qualifier !~ /^w/) ||
($extension eq "4" &&
- defined $qualifier && $qualifier !~ /^c[hnlbc]/)) {
+ defined $qualifier && $qualifier !~ /^c[hlbc]/)) {
$bad_specifier = $specifier;
last;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH] checkpatch: remove %p4cn
2025-04-29 16:07 ` [PATCH] checkpatch: remove %p4cn Aditya Garg
@ 2025-04-29 17:35 ` Joe Perches
2025-04-29 17:48 ` Aditya Garg
2025-04-30 13:49 ` [PATCH v3] " Aditya Garg
1 sibling, 1 reply; 17+ messages in thread
From: Joe Perches @ 2025-04-29 17:35 UTC (permalink / raw)
To: Aditya Garg, pmladek
Cc: admin, airlied, akpm, alyssa, andriy.shevchenko, apw, asahi,
corbet, dri-devel, dwaipayanray1, geert, kees, linux-doc,
linux-kernel, linux, lukas.bulwahn, marcan, mripard, rostedt,
senozhatsky, simona, sven, tamird, tzimmermann
On Tue, 2025-04-29 at 16:07 +0000, Aditya Garg wrote:
> %p4cn was recently removed and replaced by %p4chR in vsprintf. So,
> remove the check for %p4cn from checkpatch.pl.
>
> Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
>
> Signed-off-by: Aditya Garg <gargaditya08@live.com>
> ---
> scripts/checkpatch.pl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 44e233b6f..f79f0a085 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -6891,7 +6891,7 @@ sub process {
> ($extension eq "f" &&
> defined $qualifier && $qualifier !~ /^w/) ||
> ($extension eq "4" &&
> - defined $qualifier && $qualifier !~ /^c[hnlbc]/)) {
> + defined $qualifier && $qualifier !~ /^c[hlbc]/)) {
Probably needs to be something like:
$qualifier !~ /^c(?:[hlbc]|cR)$/
> $bad_specifier = $specifier;
> last;
> }
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH] checkpatch: remove %p4cn
2025-04-29 17:35 ` Joe Perches
@ 2025-04-29 17:48 ` Aditya Garg
0 siblings, 0 replies; 17+ messages in thread
From: Aditya Garg @ 2025-04-29 17:48 UTC (permalink / raw)
To: Joe Perches, pmladek
Cc: admin, airlied, akpm, alyssa, andriy.shevchenko, apw, asahi,
corbet, dri-devel, dwaipayanray1, geert, kees, linux-doc,
linux-kernel, linux, lukas.bulwahn, marcan, mripard, rostedt,
senozhatsky, simona, sven, tamird, tzimmermann
On 29-04-2025 11:05 pm, Joe Perches wrote:
> On Tue, 2025-04-29 at 16:07 +0000, Aditya Garg wrote:
>> %p4cn was recently removed and replaced by %p4chR in vsprintf. So,
>> remove the check for %p4cn from checkpatch.pl.
>>
>> Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
>>
>> Signed-off-by: Aditya Garg <gargaditya08@live.com>
>> ---
>> scripts/checkpatch.pl | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index 44e233b6f..f79f0a085 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -6891,7 +6891,7 @@ sub process {
>> ($extension eq "f" &&
>> defined $qualifier && $qualifier !~ /^w/) ||
>> ($extension eq "4" &&
>> - defined $qualifier && $qualifier !~ /^c[hnlbc]/)) {
>> + defined $qualifier && $qualifier !~ /^c[hlbc]/)) {
>
> Probably needs to be something like:
>
> $qualifier !~ /^c(?:[hlbc]|cR)$/
$qualifier !~ /^c(?:[hlbc]|hR)$/
I'll send a v2
>
>> $bad_specifier = $specifier;
>> last;
>> }
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3] checkpatch: remove %p4cn
2025-04-29 16:07 ` [PATCH] checkpatch: remove %p4cn Aditya Garg
2025-04-29 17:35 ` Joe Perches
@ 2025-04-30 13:49 ` Aditya Garg
2025-05-02 13:30 ` Petr Mladek
2025-05-06 15:40 ` Alyssa Rosenzweig
1 sibling, 2 replies; 17+ messages in thread
From: Aditya Garg @ 2025-04-30 13:49 UTC (permalink / raw)
To: pmladek
Cc: admin, airlied, akpm, alyssa, andriy.shevchenko, apw, asahi,
corbet, dri-devel, dwaipayanray1, geert, joe, kees, linux-doc,
linux-kernel, linux, lukas.bulwahn, marcan, mripard, rostedt,
senozhatsky, simona, sven, tamird, tzimmermann
%p4cn was recently removed and replaced by %p4chR in vsprintf. So,
remove the check for %p4cn from checkpatch.pl.
Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
v2: Add specific check for %p4chR as suggested by Joe Perches.
v3: Remove blank lines from the tag block.
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 44e233b6f..d5bde8322 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6891,7 +6891,7 @@ sub process {
($extension eq "f" &&
defined $qualifier && $qualifier !~ /^w/) ||
($extension eq "4" &&
- defined $qualifier && $qualifier !~ /^c[hnlbc]/)) {
+ defined $qualifier && $qualifier !~ /^c(?:[hlbc]|hR)$/)) {
$bad_specifier = $specifier;
last;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v3] checkpatch: remove %p4cn
2025-04-30 13:49 ` [PATCH v3] " Aditya Garg
@ 2025-05-02 13:30 ` Petr Mladek
2025-05-06 15:40 ` Alyssa Rosenzweig
1 sibling, 0 replies; 17+ messages in thread
From: Petr Mladek @ 2025-05-02 13:30 UTC (permalink / raw)
To: Aditya Garg, alyssa
Cc: admin, airlied, akpm, andriy.shevchenko, apw, asahi, corbet,
dri-devel, dwaipayanray1, geert, joe, kees, linux-doc,
linux-kernel, linux, lukas.bulwahn, marcan, mripard, rostedt,
senozhatsky, simona, sven, tamird, tzimmermann
On Wed 2025-04-30 19:19:08, Aditya Garg wrote:
> %p4cn was recently removed and replaced by %p4chR in vsprintf. So,
> remove the check for %p4cn from checkpatch.pl.
>
> Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
> Signed-off-by: Aditya Garg <gargaditya08@live.com>
Looks and works well:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Alyssa, could you please queue this one via drm-misc-next as well?
Best Regards,
Petr
PS: Aditya, thanks a lot for stepping in and providing this patch. Also
thanks others for shaping in. I was not able to react quickly. I
had technical problems with my workstation and public holidays.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v3] checkpatch: remove %p4cn
2025-04-30 13:49 ` [PATCH v3] " Aditya Garg
2025-05-02 13:30 ` Petr Mladek
@ 2025-05-06 15:40 ` Alyssa Rosenzweig
1 sibling, 0 replies; 17+ messages in thread
From: Alyssa Rosenzweig @ 2025-05-06 15:40 UTC (permalink / raw)
To: pmladek, Aditya Garg
Cc: admin, airlied, akpm, andriy.shevchenko, apw, asahi, corbet,
dri-devel, dwaipayanray1, geert, joe, kees, linux-doc,
linux-kernel, linux, lukas.bulwahn, marcan, mripard, rostedt,
senozhatsky, simona, sven, tamird, tzimmermann
On Wed, 30 Apr 2025 19:19:08 +0530, Aditya Garg wrote:
> %p4cn was recently removed and replaced by %p4chR in vsprintf. So,
> remove the check for %p4cn from checkpatch.pl.
>
>
Applied, thanks!
[1/1] checkpatch: remove %p4cn
commit: a6c0a91ccb257eaec2aee080df06863ce7601315
Best regards,
--
Alyssa Rosenzweig <alyssa@rosenzweig.io>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2] checkpatch: remove %p4cn and add check for %p4chR
2025-04-28 12:31 [PATCH] vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering Petr Mladek
` (5 preceding siblings ...)
2025-04-29 16:07 ` [PATCH] checkpatch: remove %p4cn Aditya Garg
@ 2025-04-29 17:50 ` Aditya Garg
2025-04-30 12:47 ` Andy Shevchenko
6 siblings, 1 reply; 17+ messages in thread
From: Aditya Garg @ 2025-04-29 17:50 UTC (permalink / raw)
To: pmladek
Cc: admin, airlied, akpm, alyssa, andriy.shevchenko, apw, asahi,
corbet, dri-devel, dwaipayanray1, gargaditya08, geert, joe, kees,
linux-doc, linux-kernel, linux, lukas.bulwahn, marcan, mripard,
rostedt, senozhatsky, simona, sven, tamird, tzimmermann
%p4cn was recently removed and replaced by %p4chR in vsprintf. So,
remove the check for %p4cn from checkpatch.pl.
Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
v2: Add specific check for %p4chR as suggested by Joe Perches.
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 44e233b6f..d5bde8322 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6891,7 +6891,7 @@ sub process {
($extension eq "f" &&
defined $qualifier && $qualifier !~ /^w/) ||
($extension eq "4" &&
- defined $qualifier && $qualifier !~ /^c[hnlbc]/)) {
+ defined $qualifier && $qualifier !~ /^c(?:[hlbc]|hR)$/)) {
$bad_specifier = $specifier;
last;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v2] checkpatch: remove %p4cn and add check for %p4chR
2025-04-29 17:50 ` [PATCH v2] checkpatch: remove %p4cn and add check for %p4chR Aditya Garg
@ 2025-04-30 12:47 ` Andy Shevchenko
0 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2025-04-30 12:47 UTC (permalink / raw)
To: Aditya Garg
Cc: pmladek, admin, airlied, akpm, alyssa, apw, asahi, corbet,
dri-devel, dwaipayanray1, geert, joe, kees, linux-doc,
linux-kernel, linux, lukas.bulwahn, marcan, mripard, rostedt,
senozhatsky, simona, sven, tamird, tzimmermann
On Tue, Apr 29, 2025 at 05:50:30PM +0000, Aditya Garg wrote:
> %p4cn was recently removed and replaced by %p4chR in vsprintf. So,
> remove the check for %p4cn from checkpatch.pl.
...
> Fixes: 37eed892cc5f ("vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering")
>
There shouldn't be blank lines in the tag block.
> Signed-off-by: Aditya Garg <gargaditya08@live.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 17+ messages in thread