Message ID | 1470111037-18531-7-git-send-email-gwshan@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 9a26a57..4e385f9 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -737,7 +737,9 @@ int pnv_tce_xchg(struct iommu_table *tbl, long index, if (newtce & TCE_PCI_WRITE) newtce |= TCE_PCI_READ; - oldtce = be64_to_cpu(xchg(pnv_tce(tbl, idx), cpu_to_be64(newtce))); + oldtce = be64_to_cpu((__force __be64)xchg( + (unsigned long *)pnv_tce(tbl, idx), + (__force unsigned long)cpu_to_be64(newtce))); *hpa = oldtce & ~(TCE_PCI_READ | TCE_PCI_WRITE); *direction = iommu_tce_direction(oldtce);
This fixes warning reported from sparse: gwshan@gwshan:~/sandbox/l$ make C=2 CF=-D__CHECK_ENDIAN__ \ arch/powerpc/platforms/powernv/pci.o arch/powerpc/platforms/powernv/pci.c:740:18: \ warning: cast from restricted __be64 arch/powerpc/platforms/powernv/pci.c:740:18: \ warning: cast to restricted __be64 arch/powerpc/platforms/powernv/pci.c:740:18: \ warning: cast from restricted __be64 arch/powerpc/platforms/powernv/pci.c:740:18: \ warning: cast to restricted __be64 Cc: Alexey Kardashevskiy <aik@ozlabs.ru> Fixes: 802a345183c0 ("powerpc/powernv/ioda: Fix endianness when reading TCEs") Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> --- arch/powerpc/platforms/powernv/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)