iommu-common: Fix PARISC compile-time warnings
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Fri, 17 Apr 2015 02:28:04 +0000 (22:28 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Apr 2015 19:24:36 +0000 (15:24 -0400)
Fixes warnings due to
- no DMA_ERROR_CODE on PARISC,
- sizeof (unsigned long) == 4 bytes on PARISC.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/iommu-common.c

index 7583f9b7846ba7117fcb8bdccdfacef03cdd9c34..fac4f35250c994d7465ace3f2bb1d4f0d91c85ad 100644 (file)
 #include <linux/iommu-common.h>
 #include <linux/dma-mapping.h>
 
+#ifndef        DMA_ERROR_CODE
+#define        DMA_ERROR_CODE (~(dma_addr_t)0x0)
+#endif
+
 #define IOMMU_LARGE_ALLOC      15
 
 /*
@@ -121,7 +125,7 @@ unsigned long iommu_tbl_range_alloc(struct device *dev,
                boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
                                      1 << iommu->page_table_shift);
        else
-               boundary_size = ALIGN(1UL << 32, 1 << iommu->page_table_shift);
+               boundary_size = ALIGN(1ULL << 32, 1 << iommu->page_table_shift);
 
        shift = iommu->page_table_map_base >> iommu->page_table_shift;
        boundary_size = boundary_size >> iommu->page_table_shift;