Linux IOMMU Development
 help / color / mirror / Atom feed
From: Parav Pandit <parav@nvidia.com>
To: <dwmw2@infradead.org>, <baolu.lu@linux.intel.com>,
	<iommu@lists.linux-foundation.org>
Cc: will@kernel.org
Subject: [PATCH 5/5] iommu/intel: No need to typecast
Date: Sun, 30 May 2021 10:50:53 +0300	[thread overview]
Message-ID: <20210530075053.264218-6-parav@nvidia.com> (raw)
In-Reply-To: <20210530075053.264218-1-parav@nvidia.com>

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 <parav@nvidia.com>
---
 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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2021-05-30  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30  7:50 [PATCH 0/5] Short cleanups around DMAR Parav Pandit
2021-05-30  7:50 ` [PATCH 1/5] iommu/intel: Use bitfields for DMAR capabilities Parav Pandit
2021-05-30  7:50 ` [PATCH 2/5] iommu/intel: Removed unused iommu_count in dmar domain Parav Pandit
2021-05-30  7:50 ` [PATCH 3/5] iommu/intel: Remove unnecessary braces Parav Pandit
2021-05-30  7:50 ` [PATCH 4/5] iommu/intel: Define counter explicitly as unsigned int Parav Pandit
2021-05-30  7:50 ` Parav Pandit [this message]
2021-06-09  7:43 ` [PATCH 0/5] Short cleanups around DMAR Lu Baolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210530075053.264218-6-parav@nvidia.com \
    --to=parav@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox