This fixes the 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: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 <a...@ozlabs.ru>
Fixes: c5bb44edee19 ("powerpc/powernv: Implement accessor to TCE entry")
Signed-off-by: Gavin Shan <gws...@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

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to