Skip to content

Commit 8d97124

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/dma: Remove redundant "!dev" checks
iommu_dma_init_domain() is now only called from iommu_setup_dma_ops(), which has already assumed dev to be non-NULL. Reviewed-by: John Garry <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/06024523c080364390016550065e3cfe8031367e.1628682049.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent ca84ed7 commit 8d97124

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/iommu/dma-iommu.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
370370

371371
init_iova_domain(iovad, 1UL << order, base_pfn);
372372

373-
if (!cookie->fq_domain && (!dev || !dev_is_untrusted(dev)) &&
373+
if (!cookie->fq_domain && !dev_is_untrusted(dev) &&
374374
domain->ops->flush_iotlb_all && !iommu_get_dma_strict(domain)) {
375375
if (init_iova_flush_queue(iovad, iommu_dma_flush_iotlb_all,
376376
iommu_dma_entry_dtor))
@@ -379,9 +379,6 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
379379
cookie->fq_domain = domain;
380380
}
381381

382-
if (!dev)
383-
return 0;
384-
385382
return iova_reserve_iommu_regions(dev, domain);
386383
}
387384

0 commit comments

Comments
 (0)