Page directory assignment by alloc_pgtable_page() or phys_to_virt()
doesn't need typecasting as both routines return void*.
Hence, remove typecasting from both the calls.

Signed-off-by: Parav Pandit <[email protected]>
---
 drivers/iommu/intel/iommu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 6788d10d0ff6..b3d006eb8c49 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -4508,7 +4508,7 @@ static int md_domain_init(struct dmar_domain *domain, int 
guest_width)
        domain->max_addr = 0;
 
        /* always allocate the top pgd */
-       domain->pgd = (struct dma_pte *)alloc_pgtable_page(domain->nid);
+       domain->pgd = alloc_pgtable_page(domain->nid);
        if (!domain->pgd)
                return -ENOMEM;
        domain_flush_cache(domain, domain->pgd, PAGE_SIZE);
@@ -4767,8 +4767,7 @@ static int prepare_domain_attach_device(struct 
iommu_domain *domain,
 
                pte = dmar_domain->pgd;
                if (dma_pte_present(pte)) {
-                       dmar_domain->pgd = (struct dma_pte *)
-                               phys_to_virt(dma_pte_addr(pte));
+                       dmar_domain->pgd = phys_to_virt(dma_pte_addr(pte));
                        free_pgtable_page(pte);
                }
                dmar_domain->agaw--;
-- 
2.26.2

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to