Skip to contentSkip to conversation

iommu/dma: Fix compile warning in 32-bit builds

PATCH In review Joerg Roedel 1 participant 2 messages Jun 7, 2021

Subsystems (2)
lore
Share & tools
lore

Joerg Roedel

author maintainer
#0 lore raw

PATCH 1/1 iommu/dma: Fix compile warning in 32-bit builds

From: Joerg Roedel <[email protected]>

Compiling the recent dma-iommu changes under 32-bit x86 triggers this compile warning:

drivers/iommu/dma-iommu.c:249:5: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Wformat=]

The reason is that %llx is used to print a variable of type phys_addr_t. Fix it by using the correct %pa format specifier for phys_addr_t.

Cc Srinath Mannam <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Oza Pawandeep <[email protected]>
Fixes aadad097cd46 ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address")
---
 drivers/iommu/dma-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/dma-iommu.c +2 -2
index 95e7349ac3f1..5d96fcc45fec 100644
@@ -246,8 +246,8 @@ static int iova_reserve_pci_windows(struct pci_dev *dev,
 		} else if (end < start) {
 			/* dma_ranges list should be sorted */
 			dev_err(&dev->dev,
-				"Failed to reserve IOVA [%#010llx-%#010llx]\n",
-				start, end);
+				"Failed to reserve IOVA [%pa-%pa]\n",
+				&start, &end);
 			return -EINVAL;
 		}
 
Signature · 6 lines
2.31.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
author maintainer
#1 lore raw
Quoted 7 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

Compiling the recent dma-iommu changes under 32-bit x86 triggers this compile warning:

drivers/iommu/dma-iommu.c:249:5: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Wformat=]

Quoted 8 lines

The reason is that %llx is used to print a variable of type phys_addr_t. Fix it by using the correct %pa format specifier for phys_addr_t.

Cc Srinath Mannam <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Oza Pawandeep <[email protected]>
Fixes aadad097cd46 ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address")

This tag is wrong, it should be:

Fixes 9561dd434860 ("iommu/dma: Fix IOVA reserve dma ranges")
Quoted 22 lines
---
 drivers/iommu/dma-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/dma-iommu.c +2 -2
index 95e7349ac3f1..5d96fcc45fec 100644
@@ -246,8 +246,8 @@ static int iova_reserve_pci_windows(struct pci_dev *dev,
 		} else if (end < start) {
 			/* dma_ranges list should be sorted */
 			dev_err(&dev->dev,
-				"Failed to reserve IOVA [%#010llx-%#010llx]\n",
-				start, end);
+				"Failed to reserve IOVA [%pa-%pa]\n",
+				&start, &end);
 			return -EINVAL;
 		}
 
Signature · 1 line
2.31.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu