From: Robin Murphy Date: Thu, 29 Mar 2018 11:24:52 +0000 (+0100) Subject: iommu/io-pgtable-arm: Avoid warning with 32-bit phys_addr_t X-Git-Tag: rel_imx_4.19.35_1.1.0~10321^2^8 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=7868805969942a424118b7da5233946e53ce69be;p=linux.git 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. Signed-off-by: Robin Murphy Signed-off-by: Joerg Roedel --- 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;