All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Aditya Garg <gargaditya08@live.com>
Cc: "pmladek@suse.com" <pmladek@suse.com>,
	 "rostedt@goodmis.org" <rostedt@goodmis.org>,
	 "andriy.shevchenko@linux.intel.com"
	<andriy.shevchenko@linux.intel.com>,
	 "senozhatsky@chromium.org" <senozhatsky@chromium.org>,
	 "corbet@lwn.net" <corbet@lwn.net>,
	"maarten.lankhorst@linux.intel.com"
	<maarten.lankhorst@linux.intel.com>,
	"mripard@kernel.org" <mripard@kernel.org>,
	 "tzimmermann@suse.de" <tzimmermann@suse.de>,
	 "airlied@gmail.com" <airlied@gmail.com>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	 "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	 "apw@canonical.com" <apw@canonical.com>,
	"joe@perches.com" <joe@perches.com>,
	 "dwaipayanray1@gmail.com" <dwaipayanray1@gmail.com>,
	 "lukas.bulwahn@gmail.com" <lukas.bulwahn@gmail.com>,
	 "sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
	 "christian.koenig@amd.com" <christian.koenig@amd.com>,
	 "kekrby@gmail.com" <kekrby@gmail.com>,
	"admin@kodeit.net" <admin@kodeit.net>,
	 Orlando Chamberlain <orlandoch.dev@gmail.com>,
	 "evepolonium@gmail.com" <evepolonium@gmail.com>,
	 "linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	 "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	 "linaro-mm-sig@lists.linaro.org"
	<linaro-mm-sig@lists.linaro.org>,
	 Hector Martin <marcan@marcan.st>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	 "asahi@lists.linux.dev" <asahi@lists.linux.dev>,
	 Sven Peter <sven@svenpeter.dev>,  Janne Grunau <j@jannau.net>
Subject: Re: [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc
Date: Fri, 21 Feb 2025 11:29:40 +0100	[thread overview]
Message-ID: <871pvrpp4b.fsf@prevas.dk> (raw)
In-Reply-To: <C66F35BB-2ECC-4DB8-8154-DEC5177967ED@live.com> (Aditya Garg's message of "Thu, 20 Feb 2025 16:39:23 +0000")

On Thu, Feb 20 2025, Aditya Garg <gargaditya08@live.com> wrote:

> v2 -> Add this patch
>  Documentation/core-api/printk-formats.rst | 32 +++++++++++++++++++
>  lib/test_printf.c                         | 39 +++++++++++++++++++----
>  lib/vsprintf.c                            | 38 ++++++++++++++++++----

Yay! Thanks for remembering to include test cases.

>  
> 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_struct {
> +	u32 code;
> +	const char *str;
> +};
> +
> +static void __init fourcc_pointer_test(const struct fourcc_struct *fc, size_t n,
> +				       const char *fmt)
> +{
> +	size_t i;
> +
> +	for (i = 0; i < n; i++)
> +		test(fc[i].str, fmt, &fc[i].code);
> +}
> +
>  static void __init fourcc_pointer(void)
>  {
> -	struct {
> -		u32 code;
> -		char *str;
> -	} const try[] = {
> +	struct fourcc_struct const try_cc[] = {

I know it matches the code it replaces, but kernel style seems to be
"const struct foo" rather than "struct foo const" (at around 130:1) -
just as you use in the new helper function.

Also, please consider changing the array, and the newly added instances,
to be static instead of automatic (our le32_to_cpu should be usable also
for static initializers).

This will conflict with the conversion-to-kunit which is in flight, but
the conflict should be trivial to resolve.

Rasmus

  reply	other threads:[~2025-02-21 10:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 16:38 [PATCH v2 1/3] drm/format-helper: Add conversion from XRGB8888 to BGR888 Aditya Garg
2025-02-20 16:39 ` [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc Aditya Garg
2025-02-21 10:29   ` Rasmus Villemoes [this message]
2025-02-21 11:40     ` Aditya Garg
2025-02-21 15:27   ` andriy.shevchenko
2025-02-21 19:35     ` Aditya Garg
2025-02-21 20:06       ` Aditya Garg
2025-02-21 20:23         ` andriy.shevchenko
2025-02-22 12:11     ` Aditya Garg
2025-02-22 15:46   ` Aditya Garg
2025-02-24  9:58     ` andriy.shevchenko
2025-02-24 10:18       ` Aditya Garg
2025-02-24 10:24         ` andriy.shevchenko
2025-02-24 10:32           ` Aditya Garg
2025-02-24 10:40             ` andriy.shevchenko
2025-02-24 10:43               ` Aditya Garg
2025-02-24 10:48                 ` andriy.shevchenko
2025-02-24 10:52                   ` Aditya Garg
2025-02-24 16:17   ` Aditya Garg
2025-02-27 11:21     ` Aditya Garg
2025-02-20 16:40 ` [PATCH v2 3/3] drm/tiny: add driver for Apple Touch Bars in x86 Macs Aditya Garg
2025-02-20 18:34   ` Neal Gompa
2025-02-20 20:41     ` Aditya Garg
  -- strict thread matches above, loose matches on Subject: below --
2025-02-23  6:39 [PATCH v2 2/3] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc Aditya Garg
2025-02-24 11:08 ` andriy.shevchenko
     [not found] <16F819E8-E866-4552-BB08-31486D2BA8C5@live.com>
2025-02-23 15:16 ` Aditya Garg
2025-02-24 10:57   ` andriy.shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871pvrpp4b.fsf@prevas.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=admin@kodeit.net \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=apw@canonical.com \
    --cc=asahi@lists.linux.dev \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dwaipayanray1@gmail.com \
    --cc=evepolonium@gmail.com \
    --cc=gargaditya08@live.com \
    --cc=j@jannau.net \
    --cc=joe@perches.com \
    --cc=kekrby@gmail.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lukas.bulwahn@gmail.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marcan@marcan.st \
    --cc=mripard@kernel.org \
    --cc=orlandoch.dev@gmail.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=simona@ffwll.ch \
    --cc=sumit.semwal@linaro.org \
    --cc=sven@svenpeter.dev \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.