]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'sparc/master'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 4 Nov 2015 22:59:31 +0000 (09:59 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 4 Nov 2015 22:59:31 +0000 (09:59 +1100)
1  2 
lib/iommu-common.c

diff --combined lib/iommu-common.c
index b1c93e94ca7a430ea68c717e0e26d56057d75636,0f2c887be7703f11b38d15a01f5e75aaf8660157..858dc1aae478bad9cb30275cb7fd7905d73f6ede
  #include <linux/dma-mapping.h>
  #include <linux/hash.h>
  
- #ifndef       DMA_ERROR_CODE
- #define       DMA_ERROR_CODE (~(dma_addr_t)0x0)
- #endif
  static unsigned long iommu_large_alloc = 15;
  
  static        DEFINE_PER_CPU(unsigned int, iommu_hash_common);
  
  static inline bool need_flush(struct iommu_map_table *iommu)
  {
 -      return (iommu->lazy_flush != NULL &&
 -              (iommu->flags & IOMMU_NEED_FLUSH) != 0);
 +      return ((iommu->flags & IOMMU_NEED_FLUSH) != 0);
  }
  
  static inline void set_flush(struct iommu_map_table *iommu)
@@@ -123,7 -120,7 +119,7 @@@ unsigned long iommu_tbl_range_alloc(str
        /* Sanity check */
        if (unlikely(npages == 0)) {
                WARN_ON_ONCE(1);
-               return DMA_ERROR_CODE;
+               return IOMMU_ERROR_CODE;
        }
  
        if (largealloc) {
                        goto again;
                } else {
                        /* give up */
-                       n = DMA_ERROR_CODE;
+                       n = IOMMU_ERROR_CODE;
                        goto bail;
                }
        }
 -      if (n < pool->hint || need_flush(iommu)) {
 +      if (iommu->lazy_flush &&
 +          (n < pool->hint || need_flush(iommu))) {
                clear_flush(iommu);
                iommu->lazy_flush(iommu);
        }
@@@ -259,7 -255,7 +255,7 @@@ void iommu_tbl_range_free(struct iommu_
        unsigned long flags;
        unsigned long shift = iommu->table_shift;
  
-       if (entry == DMA_ERROR_CODE) /* use default addr->entry mapping */
+       if (entry == IOMMU_ERROR_CODE) /* use default addr->entry mapping */
                entry = (dma_addr - iommu->table_map_base) >> shift;
        pool = get_pool(iommu, entry);