From 71f2d603448ed20589f232818c5b805903e7b92e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 5 Oct 2024 11:00:08 +0200 Subject: [PATCH] iommu/dma: don't align in iommu_dma_free_iova state->addr and state->size cover the entire iova range, there is no need to align them. Also don't bother with the gather structure when it's not used for anything. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 0483fab229ef..a01a5d9d7ea5 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1768,14 +1768,8 @@ void iommu_dma_free_iova(struct dma_iova_state *state) { struct iommu_domain *domain = iommu_get_dma_domain(state->dev); struct iommu_dma_cookie *cookie = domain->iova_cookie; - struct iova_domain *iovad = &cookie->iovad; - size_t iova_off = iova_offset(iovad, state->addr); - struct iommu_iotlb_gather iotlb_gather; - iommu_iotlb_gather_init(&iotlb_gather); - __iommu_dma_free_iova(cookie, state->addr - iova_off, - iova_align(iovad, state->size + iova_off), - &iotlb_gather); + __iommu_dma_free_iova(cookie, state->addr, state->size, NULL); } int iommu_dma_start_range(struct device *dev) -- 2.49.0