Skip to contentSkip to conversation

iommu: Fix printk arg in of_iommu_get_resv_regions()

PATCH Applied Daniel Mentz 3 participants 3 messages Nov 8, 2023 – Dec 1, 2023 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: Fix printk arg in of_iommu_get_resv_regions()

The variable phys is defined as (struct resource *) which aligns with the printk format specifier %pr. Taking the address of it results in a value of type (struct resource **) which is incompatible with the format specifier %pr. Therefore, remove the address of operator (&).

Fixes a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
---
 drivers/iommu/of_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/of_iommu.c +1 -1
index 157b286e36bf..d1f3b92560bc 100644
@@ -191,7 +191,7 @@ iommu_resv_region_get_type(struct device *dev,
 	if (start == phys->start && end == phys->end)
 		return IOMMU_RESV_DIRECT;
 
-	dev_warn(dev, "treating non-direct mapping [%pr] -> [%pap-%pap] as reservation\n", &phys,
+	dev_warn(dev, "treating non-direct mapping [%pr] -> [%pap-%pap] as reservation\n", phys,
 		 &start, &end);
 	return IOMMU_RESV_RESERVED;
 }
Signature · 1 line
2.42.0.869.gea05f2083d-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Daniel Mentz

The variable phys is defined as (struct resource *) which aligns with the printk format specifier %pr. Taking the address of it results in a value of type (struct resource **) which is incompatible with the format specifier %pr. Therefore, remove the address of operator (&).

Fixes a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
---
 drivers/iommu/of_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Ugh... I don't know why I missed that, because I thought I had tested that path. In any case, this fix is correct, so:

Applied
#2 lore raw
In reply to Daniel Mentz
Quoted 2 lines · Daniel Mentz
 drivers/iommu/of_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 10 lines
Jörg Rödel
[email protected]

SUSE Software Solutions Germany GmbH
Frankenstraße 146
90461 Nürnberg
Germany

(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman