diff mbox series

[2/8] iommu/vt-d: Update the definition of the blocking domain

Message ID 2-v1-8060f06462cc+c0a39-dart_paging_jgg@nvidia.com (mailing list archive)
State Handled Elsewhere
Headers show
Series iommu: Convert dart & iommufd to the new domain_alloc_paging() | expand

Commit Message

Jason Gunthorpe Sept. 22, 2023, 5:07 p.m. UTC
The global static should pre-define the type and the NOP free function can
be now left as NULL.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/intel/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Baolu Lu Sept. 25, 2023, 2:27 a.m. UTC | #1
On 9/23/23 1:07 AM, Jason Gunthorpe wrote:
> The global static should pre-define the type and the NOP free function can
> be now left as NULL.
> 
> Signed-off-by: Jason Gunthorpe<jgg@nvidia.com>
> ---
>   drivers/iommu/intel/iommu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu
diff mbox series

Patch

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index c8036caad24e7a..0d0cb2534972a2 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -4029,9 +4029,9 @@  static int blocking_domain_attach_dev(struct iommu_domain *domain,
 }
 
 static struct iommu_domain blocking_domain = {
+	.type = IOMMU_DOMAIN_BLOCKED,
 	.ops = &(const struct iommu_domain_ops) {
 		.attach_dev	= blocking_domain_attach_dev,
-		.free		= intel_iommu_domain_free
 	}
 };
 
@@ -4075,7 +4075,7 @@  static struct iommu_domain *intel_iommu_domain_alloc(unsigned type)
 
 static void intel_iommu_domain_free(struct iommu_domain *domain)
 {
-	if (domain != &si_domain->domain && domain != &blocking_domain)
+	if (domain != &si_domain->domain)
 		domain_exit(to_dmar_domain(domain));
 }