The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Nirujogi, Pratap" <pnirujog@amd.com>
To: Arnd Bergmann <arnd@kernel.org>, Bin Du <bin.du@amd.com>,
	Nirujogi Pratap <pratap.nirujogi@amd.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sultan Alsawaf <sultan@kerneltoast.com>,
	Svetoslav Stoilov <Svetoslav.Stoilov@amd.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning
Date: Fri, 8 May 2026 14:06:12 -0400	[thread overview]
Message-ID: <5086ff26-5635-405e-a364-b8aa63a1b4a9@amd.com> (raw)
In-Reply-To: <20260508124402.3082615-1-arnd@kernel.org>



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
> 


  reply	other threads:[~2026-05-08 18:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 12:43 [PATCH] [v2] media: platform: amd: avoid -Wformat-security warning Arnd Bergmann
2026-05-08 18:06 ` Nirujogi, Pratap [this message]
2026-05-08 18:47 ` David Laight

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=5086ff26-5635-405e-a364-b8aa63a1b4a9@amd.com \
    --to=pnirujog@amd.com \
    --cc=Svetoslav.Stoilov@amd.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=bin.du@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pratap.nirujogi@amd.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sultan@kerneltoast.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox