These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / include / linux / dma-mapping.h
index ac07ff0..2e551e2 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_DMA_MAPPING_H
 #define _LINUX_DMA_MAPPING_H
 
+#include <linux/sizes.h>
 #include <linux/string.h>
 #include <linux/device.h>
 #include <linux/err.h>
@@ -145,7 +146,9 @@ static inline void arch_teardown_dma_ops(struct device *dev) { }
 
 static inline unsigned int dma_get_max_seg_size(struct device *dev)
 {
-       return dev->dma_parms ? dev->dma_parms->max_segment_size : 65536;
+       if (dev->dma_parms && dev->dma_parms->max_segment_size)
+               return dev->dma_parms->max_segment_size;
+       return SZ_64K;
 }
 
 static inline unsigned int dma_set_max_seg_size(struct device *dev,
@@ -154,14 +157,15 @@ static inline unsigned int dma_set_max_seg_size(struct device *dev,
        if (dev->dma_parms) {
                dev->dma_parms->max_segment_size = size;
                return 0;
-       } else
-               return -EIO;
+       }
+       return -EIO;
 }
 
 static inline unsigned long dma_get_seg_boundary(struct device *dev)
 {
-       return dev->dma_parms ?
-               dev->dma_parms->segment_boundary_mask : 0xffffffff;
+       if (dev->dma_parms && dev->dma_parms->segment_boundary_mask)
+               return dev->dma_parms->segment_boundary_mask;
+       return DMA_BIT_MASK(32);
 }
 
 static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
@@ -169,8 +173,8 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
        if (dev->dma_parms) {
                dev->dma_parms->segment_boundary_mask = mask;
                return 0;
-       } else
-               return -EIO;
+       }
+       return -EIO;
 }
 
 #ifndef dma_max_pfn