iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t
Subsystems (2)
Robin Murphy
reviewerPATCH 1/1 iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t
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.
---
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(-)
drivers/iommu/io-pgtable-arm.c +1 -1
@@ -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;
Signature · 1 line
2.16.1.dirty
PATCH 1/1 iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t
Quoted 10 lines · Robin Murphy
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 <[email protected]>---
Quoted 8 lines
Oops, I managed to totally overlook that
phys_addr_twould 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.