From: Arnd Bergmann <arnd@kernel.org>
To: Benjamin Gaignard <benjamin.gaignard@collabora.com>,
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: [PATCH] iommu: vsi: avoid -Wformat-security warning
Date: Tue, 19 May 2026 22:36:51 +0200 [thread overview]
Message-ID: <20260519203658.1341889-1-arnd@kernel.org> (raw)
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>
---
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;
--
2.39.5
next reply other threads:[~2026-05-19 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 20:36 Arnd Bergmann [this message]
2026-05-20 12:59 ` [PATCH] iommu: vsi: avoid -Wformat-security warning Benjamin Gaignard
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=20260519203658.1341889-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=benjamin.gaignard@collabora.com \
--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