[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <302ead12-9bb1-4c22-adf5-c89c2e6d059e@app.fastmail.com>
Date: Fri, 30 Aug 2024 16:31:08 -0700
From: "Daniel Xu" <dxu@...uu.xyz>
To: "Alexander Lobakin" <aleksander.lobakin@...el.com>,
"Alexei Starovoitov" <ast@...nel.org>,
"Daniel Borkmann" <daniel@...earbox.net>,
"Andrii Nakryiko" <andrii@...nel.org>
Cc: "Lorenzo Bianconi" <lorenzo@...nel.org>,
"John Fastabend" <john.fastabend@...il.com>,
"Jesper Dangaard Brouer" <hawk@...nel.org>,
"Martin KaFai Lau" <martin.lau@...ux.dev>,
"David Miller" <davem@...emloft.net>, "Eric Dumazet" <edumazet@...gle.com>,
"Jakub Kicinski" <kuba@...nel.org>, "Paolo Abeni" <pabeni@...hat.com>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next 1/9] firmware/psci: fix missing '%u' format literal in
kthread_create_on_cpu()
On Fri, Aug 30, 2024, at 9:25 AM, Alexander Lobakin wrote:
> kthread_create_on_cpu() always requires format string to contain one
> '%u' at the end, as it automatically adds the CPU ID when passing it
> to kthread_create_on_node(). The former doesn't marked as __printf()
> as it's not printf-like itself, which effectively hides this from
> the compiler.
> If you convert this function to printf-like, you'll see the following:
>
> In file included from drivers/firmware/psci/psci_checker.c:15:
> drivers/firmware/psci/psci_checker.c: In function 'suspend_tests':
> drivers/firmware/psci/psci_checker.c:401:48: warning: too many
> arguments for format [-Wformat-extra-args]
> 401 |
> "psci_suspend_test");
> |
> ^~~~~~~~~~~~~~~~~~~
> drivers/firmware/psci/psci_checker.c:400:32: warning: data argument not
> used by format string [-Wformat-extra-args]
> 400 | (void
> *)(long)cpu, cpu,
> |
> ^
> 401 |
> "psci_suspend_test");
> |
> ~~~~~~~~~~~~~~~~~~~
>
> Add the missing format literal to fix this. Now the corresponding
> kthread will be named as "psci_suspend_test-<cpuid>", as it's meant by
> kthread_create_on_cpu().
>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202408141012.KhvKaxoh-lkp@intel.com
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202408141243.eQiEOQQe-lkp@intel.com
> Fixes: ea8b1c4a6019 ("drivers: psci: PSCI checker module")
> Cc: stable@...r.kernel.org # 4.10+
> Signed-off-by: Alexander Lobakin <aleksander.lobakin@...el.com>
> ---
> drivers/firmware/psci/psci_checker.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/psci/psci_checker.c
> b/drivers/firmware/psci/psci_checker.c
> index 116eb465cdb4..ecc511c745ce 100644
> --- a/drivers/firmware/psci/psci_checker.c
> +++ b/drivers/firmware/psci/psci_checker.c
> @@ -398,7 +398,7 @@ static int suspend_tests(void)
>
> thread = kthread_create_on_cpu(suspend_test_thread,
> (void *)(long)cpu, cpu,
> - "psci_suspend_test");
> + "psci_suspend_test-%u");
> if (IS_ERR(thread))
> pr_err("Failed to create kthread on CPU %d\n", cpu);
> else
> --
> 2.46.0
Acked-by: Daniel Xu <dxu@...uu.xyz>
Powered by blists - more mailing lists