[PATCH 5/9] powerpc/powernv: Fix endian for return value from pnv_tce_get()
Gavin Shan
gwshan at linux.vnet.ibm.com
Tue Aug 2 14:10:33 AEST 2016
This fixes the warning reported from sparse:
gwshan at gwshan:~/sandbox/l$ make C=2 CF=-D__CHECK_ENDIAN__ \
arch/powerpc/platforms/powernv/pci.o
:
arch/powerpc/platforms/powernv/pci.c:761:16: \
warning: incorrect type in return expression (different base types)
arch/powerpc/platforms/powernv/pci.c:761:16: \
expected unsigned long
arch/powerpc/platforms/powernv/pci.c:761:16: \
got restricted __be64 [usertype] <noident>
Cc: Alexey Kardashevskiy <aik at ozlabs.ru>
Fixes: c5bb44edee19 ("powerpc/powernv: Implement accessor to TCE entry")
Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index b32bafb..9a26a57 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -758,7 +758,7 @@ void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
{
- return *(pnv_tce(tbl, index - tbl->it_offset));
+ return (__force unsigned long)(*(pnv_tce(tbl, index - tbl->it_offset)));
}
struct iommu_table *pnv_pci_table_alloc(int nid)
--
2.1.0
More information about the Linuxppc-dev
mailing list