All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/dma: Fix compile warning in 32-bit builds
@ 2021-06-07 12:49 Joerg Roedel
  2021-06-07 13:01 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Joerg Roedel @ 2021-06-07 12:49 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon
  Cc: Robin Murphy, iommu, Joerg Roedel, Srinath Mannam, Oza Pawandeep

From: Joerg Roedel <jroedel@suse.de>

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 <srinath.mannam@broadcom.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Oza Pawandeep <poza@codeaurora.org>
Fixes: aadad097cd46 ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/dma-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 95e7349ac3f1..5d96fcc45fec 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -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;
 		}
 
-- 
2.31.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iommu/dma: Fix compile warning in 32-bit builds
  2021-06-07 12:49 [PATCH] iommu/dma: Fix compile warning in 32-bit builds Joerg Roedel
@ 2021-06-07 13:01 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2021-06-07 13:01 UTC (permalink / raw)
  To: Will Deacon
  Cc: Robin Murphy, iommu, Joerg Roedel, Srinath Mannam, Oza Pawandeep

On Mon, Jun 07, 2021 at 02:49:05PM +0200, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> 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 <srinath.mannam@broadcom.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Oza Pawandeep <poza@codeaurora.org>
> 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")

> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  drivers/iommu/dma-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
> index 95e7349ac3f1..5d96fcc45fec 100644
> --- a/drivers/iommu/dma-iommu.c
> +++ b/drivers/iommu/dma-iommu.c
> @@ -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;
>  		}
>  
> -- 
> 2.31.1
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-07 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 12:49 [PATCH] iommu/dma: Fix compile warning in 32-bit builds Joerg Roedel
2021-06-07 13:01 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.