* [PATCH] iommu: vsi: avoid -Wformat-security warning
@ 2026-05-19 20:36 Arnd Bergmann
2026-05-20 12:59 ` Benjamin Gaignard
2026-05-28 7:30 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-05-19 20:36 UTC (permalink / raw)
To: Benjamin Gaignard, Joerg Roedel, Will Deacon
Cc: Arnd Bergmann, Robin Murphy, iommu, linux-kernel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu: vsi: avoid -Wformat-security warning
2026-05-19 20:36 [PATCH] iommu: vsi: avoid -Wformat-security warning Arnd Bergmann
@ 2026-05-20 12:59 ` Benjamin Gaignard
2026-05-28 7:30 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2026-05-20 12:59 UTC (permalink / raw)
To: Arnd Bergmann, Joerg Roedel, Will Deacon
Cc: Arnd Bergmann, Robin Murphy, iommu, linux-kernel
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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu: vsi: avoid -Wformat-security warning
2026-05-19 20:36 [PATCH] iommu: vsi: avoid -Wformat-security warning Arnd Bergmann
2026-05-20 12:59 ` Benjamin Gaignard
@ 2026-05-28 7:30 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2026-05-28 7:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Benjamin Gaignard, Will Deacon, Arnd Bergmann, Robin Murphy,
iommu, linux-kernel
On Tue, May 19, 2026 at 10:36:51PM +0200, Arnd Bergmann wrote:
> drivers/iommu/vsi-iommu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-28 7:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 20:36 [PATCH] iommu: vsi: avoid -Wformat-security warning Arnd Bergmann
2026-05-20 12:59 ` Benjamin Gaignard
2026-05-28 7:30 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox