X-Git-Url: http://git.agner.ch/gitweb/?a=blobdiff_plain;f=lib%2Fiommu-common.c;h=b1c93e94ca7a430ea68c717e0e26d56057d75636;hb=b0d58113e55dca8b95161be30e1a15703ecf9a2a;hp=ff19f66d3f7fbd635a44cc03614b5fbe4485cc56;hpb=b9ffce9ae14fa6068a7c8c3ce2350ee3a8c1787b;p=linux-drm-fsl-dcu.git diff --git a/lib/iommu-common.c b/lib/iommu-common.c index ff19f66d3f7f..b1c93e94ca7a 100644 --- a/lib/iommu-common.c +++ b/lib/iommu-common.c @@ -21,8 +21,7 @@ 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) @@ -211,7 +210,8 @@ unsigned long iommu_tbl_range_alloc(struct device *dev, 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); }