Skip to contentSkip to conversation

iommu/tegra: Print phys_addr_t using %pa

PATCH In review Thierry Reding 2 participants 3 messages Sep 17, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/tegra: Print phys_addr_t using %pa

When enabling LPAE on ARM, phys_addr_t becomes 64 bits wide and printing a variable of that type using a simple %x format specifier causes the compiler to complain. Change the format specifier to %pa, which is used specifically for variables of type phys_addr_t.

---
Olof has been sending patches to fix up similar issues, but I couldn't find one that fixes these warnings. If Olof sent a patch for this and I missed it, please ignore.

 drivers/iommu/tegra-gart.c | 6 +++---
 drivers/iommu/tegra-smmu.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/iommu/tegra-gart.c +3 -3
index 108c0e9..8993999 100644
@@ -252,7 +252,7 @@ static int gart_iommu_map(struct iommu_domain *domain, unsigned long iova,
 	spin_lock_irqsave(&gart->pte_lock, flags);
 	pfn = __phys_to_pfn(pa);
 	if (!pfn_valid(pfn)) {
-		dev_err(gart->dev, "Invalid page: %08x\n", pa);
+		dev_err(gart->dev, "Invalid page: %pa\n", &pa);
 		spin_unlock_irqrestore(&gart->pte_lock, flags);
 		return -EINVAL;
 	}
@@ -295,8 +295,8 @@ static phys_addr_t gart_iommu_iova_to_phys(struct iommu_domain *domain,
 
 	pa = (pte & GART_PAGE_MASK);
 	if (!pfn_valid(__phys_to_pfn(pa))) {
-		dev_err(gart->dev, "No entry for %08llx:%08x\n",
-			 (unsigned long long)iova, pa);
+		dev_err(gart->dev, "No entry for %08llx:%pa\n",
+			 (unsigned long long)iova, &pa);
 		gart_dump_table(gart);
 		return -EINVAL;
 	}
drivers/iommu/tegra-smmu.c +1 -1
index e066560..34374b3 100644
@@ -731,7 +731,7 @@ static int smmu_iommu_map(struct iommu_domain *domain, unsigned long iova,
 	unsigned long pfn = __phys_to_pfn(pa);
 	unsigned long flags;
 
-	dev_dbg(as->smmu->dev, "[%d] %08lx:%08x\n", as->asid, iova, pa);
+	dev_dbg(as->smmu->dev, "[%d] %08lx:%pa\n", as->asid, iova, &pa);
 
 	if (!pfn_valid(pfn))
 		return -ENOMEM;
Signature · 1 line
1.8.4

A message that is not in the archive (sent off-list or not yet received): 1379405971-2693-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 6 lines · Thierry Reding

When enabling LPAE on ARM, phys_addr_t becomes 64 bits wide and printing a variable of that type using a simple %x format specifier causes the compiler to complain. Change the format specifier to %pa, which is used specifically for variables of type phys_addr_t.

Quoted 3 lines

Olof has been sending patches to fix up similar issues, but I couldn't find one that fixes these warnings. If Olof sent a patch for this and I missed it, please ignore.

Nope, I hadn't seen these ones since I was only looking at multi_v7_defconfig at the time, and these are only enabled with tegra_defconfig at the moment.

-Olof

#3 lore raw
In reply to a message not in the archive
Quoted 6 lines · Thierry Reding

When enabling LPAE on ARM, phys_addr_t becomes 64 bits wide and printing a variable of that type using a simple %x format specifier causes the compiler to complain. Change the format specifier to %pa, which is used specifically for variables of type phys_addr_t.

Quoted 3 lines

Olof has been sending patches to fix up similar issues, but I couldn't find one that fixes these warnings. If Olof sent a patch for this and I missed it, please ignore.

Nope, I hadn't seen these ones since I was only looking at multi_v7_defconfig at the time, and these are only enabled with tegra_defconfig at the moment.

-Olof