summaryrefslogtreecommitdiff
path: root/lib/iommu-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/iommu-common.c')
-rw-r--r--lib/iommu-common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/iommu-common.c b/lib/iommu-common.c
index 0f2c887be770..858dc1aae478 100644
--- a/lib/iommu-common.c
+++ b/lib/iommu-common.c
@@ -17,8 +17,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)
@@ -207,7 +206,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);
}