iommu/arm-smmu: Avoid build warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 30 Jan 2015 21:55:55 +0000 (22:55 +0100)
committerJoerg Roedel <jroedel@suse.de>
Tue, 3 Feb 2015 17:53:27 +0000 (18:53 +0100)
ARM allmodconfig gained a new warning when dma_addr_t is 32-bit wide:

drivers/iommu/arm-smmu.c: In function 'arm_smmu_iova_to_phys_hard':
drivers/iommu/arm-smmu.c:1255:3: warning: right shift count >= width of type

This changes the calculation so that the effective type is always
64-bit.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 859a732e4f713 ("iommu/arm-smmu: add support for iova_to_phys through ATS1PR")
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/arm-smmu.c

index 1d6d43bb3395296bc7b5a63830113362086ceb13..fc13dd56953e1eb2cb25107ef017336546b733a7 100644 (file)
@@ -1252,7 +1252,7 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,
        } else {
                u32 reg = iova & ~0xfff;
                writel_relaxed(reg, cb_base + ARM_SMMU_CB_ATS1PR_LO);
-               reg = (iova & ~0xfff) >> 32;
+               reg = ((u64)iova & ~0xfff) >> 32;
                writel_relaxed(reg, cb_base + ARM_SMMU_CB_ATS1PR_HI);
        }