[PATCH 9/9] powerpc/powernv: Fix data type in pnv_pci_ioda2_table_do_free_pages()

Gavin Shan gwshan at linux.vnet.ibm.com
Tue Aug 2 14:10:37 AEST 2016


This fixes warning reported from sparse:

  gwshan at gwshan:~/sandbox/l$ make C=2 CF=-D__CHECK_ENDIAN__ \
                             arch/powerpc/platforms/powernv/pci-ioda.o
        :
  arch/powerpc/platforms/powernv/pci-ioda.c:2647:45: \
  warning: cast to restricted __be64

Cc: Alexey Kardashevskiy <aik at ozlabs.ru>
Fixes: bbb845c4bac8 ("powerpc/powernv: Implement multilevel TCE tables")
Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 3d367ba..cc2d28c 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2644,7 +2644,8 @@ static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr,
 		u64 *tmp = (u64 *) addr_ul;
 
 		for (i = 0; i < size; ++i) {
-			unsigned long hpa = be64_to_cpu(tmp[i]);
+			unsigned long hpa =
+				be64_to_cpu((__force __be64)(tmp[i]));
 
 			if (!(hpa & (TCE_PCI_READ | TCE_PCI_WRITE)))
 				continue;
-- 
2.1.0



More information about the Linuxppc-dev mailing list