From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
To: Arnd Bergmann <arnd@kernel.org>, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Robin Murphy <robin.murphy@arm.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu: vsi: avoid -Wformat-security warning
Date: Wed, 20 May 2026 14:59:15 +0200 [thread overview]
Message-ID: <fcedc7d8-f93e-4d96-b23a-fb9ad5a1f534@collabora.com> (raw)
In-Reply-To: <20260519203658.1341889-1-arnd@kernel.org>
Le 19/05/2026 à 22:36, Arnd Bergmann a écrit :
> From: Arnd Bergmann <arnd@arndb.de>
>
> When -Wformat-security is enabled, it catches a call to
> iommu_device_sysfs_add() that passes a string variable in
> place of a format:
>
> drivers/iommu/vsi-iommu.c: In function 'vsi_iommu_probe':
> drivers/iommu/vsi-iommu.c:717:9: error: format not a string literal and no format arguments [-Werror=format-security]
> 717 | err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, dev_name(dev));
> | ^~~
>
> Pass this indirectly using "%s" as the format instead.
>
> Fixes: 917ace84b770 ("iommu: Add verisilicon IOMMU driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> drivers/iommu/vsi-iommu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
> index 5d0721bd2c7a..23913720d484 100644
> --- a/drivers/iommu/vsi-iommu.c
> +++ b/drivers/iommu/vsi-iommu.c
> @@ -714,7 +714,8 @@ static int vsi_iommu_probe(struct platform_device *pdev)
> pm_runtime_use_autosuspend(dev);
> pm_runtime_enable(dev);
>
> - err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, dev_name(dev));
> + err = iommu_device_sysfs_add(&iommu->iommu, dev, NULL, "%s",
> + dev_name(dev));
> if (err)
> goto err_runtime_disable;
>
next prev parent reply other threads:[~2026-05-20 12:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 20:36 Arnd Bergmann
2026-05-20 12:59 ` Benjamin Gaignard [this message]
2026-05-28 7:30 ` Joerg Roedel
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=fcedc7d8-f93e-4d96-b23a-fb9ad5a1f534@collabora.com \
--to=benjamin.gaignard@collabora.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®