* [PATCH] iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t
@ 2018-03-29 11:24 Robin Murphy
2018-03-29 13:22 ` Joerg Roedel
0 siblings, 1 reply; 2+ messages in thread
From: Robin Murphy @ 2018-03-29 11:24 UTC (permalink / raw)
To: linux-arm-kernel
It's not entirely unreasonable for io-pgtable-arm to be built for
configurations with 32-bit phys_addr_t, where the compiler rightly
raises a warning about the 36-bit shift. That particular code path
should never actually *run* on those systems, but we still want it
to compile cleanly, which is easily done by using an unambiguous u64
as the intermediate type instead.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Oops, I managed to totally overlook that phys_addr_t would be
configuration-dependent, sorry :(
If this can't sneak in on top of the SMMU pull, I'll resend it
as a fix for -rc1. It shouldn't be super-critical.
drivers/iommu/io-pgtable-arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index a5be4c92c5c8..47b64d3b833f 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -211,7 +211,7 @@ static arm_lpae_iopte paddr_to_iopte(phys_addr_t paddr,
static phys_addr_t iopte_to_paddr(arm_lpae_iopte pte,
struct arm_lpae_io_pgtable *data)
{
- phys_addr_t paddr = pte & ARM_LPAE_PTE_ADDR_MASK;
+ u64 paddr = pte & ARM_LPAE_PTE_ADDR_MASK;
if (data->pg_shift < 16)
return paddr;
--
2.16.1.dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t
2018-03-29 11:24 [PATCH] iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t Robin Murphy
@ 2018-03-29 13:22 ` Joerg Roedel
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2018-03-29 13:22 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 29, 2018 at 12:24:52PM +0100, Robin Murphy wrote:
> It's not entirely unreasonable for io-pgtable-arm to be built for
> configurations with 32-bit phys_addr_t, where the compiler rightly
> raises a warning about the 36-bit shift. That particular code path
> should never actually *run* on those systems, but we still want it
> to compile cleanly, which is easily done by using an unambiguous u64
> as the intermediate type instead.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
>
> Oops, I managed to totally overlook that phys_addr_t would be
> configuration-dependent, sorry :(
>
> If this can't sneak in on top of the SMMU pull, I'll resend it
> as a fix for -rc1. It shouldn't be super-critical.
>
> drivers/iommu/io-pgtable-arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied it, thanks Robin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-29 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-29 11:24 [PATCH] iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t Robin Murphy
2018-03-29 13:22 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).