* [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning
@ 2026-05-08 12:43 Arnd Bergmann
2026-05-08 18:06 ` Nirujogi, Pratap
2026-05-08 18:47 ` David Laight
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-05-08 12:43 UTC (permalink / raw)
To: Bin Du, Nirujogi Pratap, Mauro Carvalho Chehab, Sultan Alsawaf,
Svetoslav Stoilov, Sakari Ailus
Cc: Arnd Bergmann, Bin Du, linux-media, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The newly added kthread_run() call passes a string variable as an sprintf()
style format, which gcc warns about when -Wformat-security is enabled:
drivers/media/platform/amd/isp4/isp4_subdev.c: In function 'isp4sd_start_resp_proc_threads':
include/linux/kthread.h:71:16: error: format not a string literal and no format arguments [-Werror=format-security]
71 | struct task_struct *__k \
| ^~~~~~~~~~~
drivers/media/platform/amd/isp4/isp4_subdev.c:596:38: note: in expansion of macro 'kthread_run'
596 | thread_ctx->thread = kthread_run(isp4sd_fw_resp_thread,
| ^~~~~~~~~~~
Use an indirect "%s" format to do this safely, avoiding the warning.
Fixes: 4e5e7a7ddb4a ("media: platform: amd: isp4 subdev and firmware loading handling added")
Tested-by: Bin Du <Bin.Du@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: avoid overly long line
---
drivers/media/platform/amd/isp4/isp4_subdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/amd/isp4/isp4_subdev.c b/drivers/media/platform/amd/isp4/isp4_subdev.c
index 48deea79ce6c..427e9ba910bb 100644
--- a/drivers/media/platform/amd/isp4/isp4_subdev.c
+++ b/drivers/media/platform/amd/isp4/isp4_subdev.c
@@ -595,6 +595,7 @@ static int isp4sd_start_resp_proc_threads(struct isp4_subdev *isp_subdev)
thread_ctx->thread = kthread_run(isp4sd_fw_resp_thread,
&isp_subdev->isp_resp_para[i],
+ "%s",
isp4sd_thread_name[i]);
if (IS_ERR(thread_ctx->thread)) {
dev_err(dev, "create thread [%d] fail\n", i);
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning
2026-05-08 12:43 [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning Arnd Bergmann
@ 2026-05-08 18:06 ` Nirujogi, Pratap
2026-05-08 18:47 ` David Laight
1 sibling, 0 replies; 3+ messages in thread
From: Nirujogi, Pratap @ 2026-05-08 18:06 UTC (permalink / raw)
To: Arnd Bergmann, Bin Du, Nirujogi Pratap, Mauro Carvalho Chehab,
Sultan Alsawaf, Svetoslav Stoilov, Sakari Ailus
Cc: Arnd Bergmann, linux-media, linux-kernel
On 5/8/2026 8:43 AM, Arnd Bergmann wrote:
> [You don't often get email from arnd@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added kthread_run() call passes a string variable as an sprintf()
> style format, which gcc warns about when -Wformat-security is enabled:
>
> drivers/media/platform/amd/isp4/isp4_subdev.c: In function 'isp4sd_start_resp_proc_threads':
> include/linux/kthread.h:71:16: error: format not a string literal and no format arguments [-Werror=format-security]
> 71 | struct task_struct *__k \
> | ^~~~~~~~~~~
> drivers/media/platform/amd/isp4/isp4_subdev.c:596:38: note: in expansion of macro 'kthread_run'
> 596 | thread_ctx->thread = kthread_run(isp4sd_fw_resp_thread,
> | ^~~~~~~~~~~
>
> Use an indirect "%s" format to do this safely, avoiding the warning.
>
> Fixes: 4e5e7a7ddb4a ("media: platform: amd: isp4 subdev and firmware loading handling added")
> Tested-by: Bin Du <Bin.Du@amd.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Thanks,
Pratap
> ---
> v2: avoid overly long line
> ---
> drivers/media/platform/amd/isp4/isp4_subdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/amd/isp4/isp4_subdev.c b/drivers/media/platform/amd/isp4/isp4_subdev.c
> index 48deea79ce6c..427e9ba910bb 100644
> --- a/drivers/media/platform/amd/isp4/isp4_subdev.c
> +++ b/drivers/media/platform/amd/isp4/isp4_subdev.c
> @@ -595,6 +595,7 @@ static int isp4sd_start_resp_proc_threads(struct isp4_subdev *isp_subdev)
>
> thread_ctx->thread = kthread_run(isp4sd_fw_resp_thread,
> &isp_subdev->isp_resp_para[i],
> + "%s",
> isp4sd_thread_name[i]);
> if (IS_ERR(thread_ctx->thread)) {
> dev_err(dev, "create thread [%d] fail\n", i);
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning
2026-05-08 12:43 [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning Arnd Bergmann
2026-05-08 18:06 ` Nirujogi, Pratap
@ 2026-05-08 18:47 ` David Laight
1 sibling, 0 replies; 3+ messages in thread
From: David Laight @ 2026-05-08 18:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Bin Du, Nirujogi Pratap, Mauro Carvalho Chehab, Sultan Alsawaf,
Svetoslav Stoilov, Sakari Ailus, Arnd Bergmann, linux-media,
linux-kernel
On Fri, 8 May 2026 14:43:49 +0200
Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added kthread_run() call passes a string variable as an sprintf()
> style format, which gcc warns about when -Wformat-security is enabled:
>
> drivers/media/platform/amd/isp4/isp4_subdev.c: In function 'isp4sd_start_resp_proc_threads':
> include/linux/kthread.h:71:16: error: format not a string literal and no format arguments [-Werror=format-security]
> 71 | struct task_struct *__k \
> | ^~~~~~~~~~~
> drivers/media/platform/amd/isp4/isp4_subdev.c:596:38: note: in expansion of macro 'kthread_run'
> 596 | thread_ctx->thread = kthread_run(isp4sd_fw_resp_thread,
> | ^~~~~~~~~~~
>
> Use an indirect "%s" format to do this safely, avoiding the warning.
>
> Fixes: 4e5e7a7ddb4a ("media: platform: amd: isp4 subdev and firmware loading handling added")
> Tested-by: Bin Du <Bin.Du@amd.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: avoid overly long line
> ---
> drivers/media/platform/amd/isp4/isp4_subdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/amd/isp4/isp4_subdev.c b/drivers/media/platform/amd/isp4/isp4_subdev.c
> index 48deea79ce6c..427e9ba910bb 100644
> --- a/drivers/media/platform/amd/isp4/isp4_subdev.c
> +++ b/drivers/media/platform/amd/isp4/isp4_subdev.c
> @@ -595,6 +595,7 @@ static int isp4sd_start_resp_proc_threads(struct isp4_subdev *isp_subdev)
>
> thread_ctx->thread = kthread_run(isp4sd_fw_resp_thread,
> &isp_subdev->isp_resp_para[i],
> + "%s",
> isp4sd_thread_name[i]);
I don't think the line break is needed.
I always prefer a line break between the format and arguments when the whole
lot doesn't fit on one line; but here it fits.
-- David
> if (IS_ERR(thread_ctx->thread)) {
> dev_err(dev, "create thread [%d] fail\n", i);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-08 18:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 12:43 [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning Arnd Bergmann
2026-05-08 18:06 ` Nirujogi, Pratap
2026-05-08 18:47 ` David Laight
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox