[PATCH 6/6] iommu/vt-d: Simplify check in identity_mapping()

Tim Gardner tim.gardner at canonical.com
Tue Apr 6 17:12:28 UTC 2021


From: Joerg Roedel <jroedel at suse.de>

BugLink: https://bugs.launchpad.net/bugs/1922738

The function only has one call-site and there it is never called with
dummy or deferred devices. Simplify the check in the function to
account for that.

Fixes: 1ee0186b9a12 ("iommu/vt-d: Refactor find_domain() helper")
Cc: stable at vger.kernel.org # v5.5
Reviewed-by: Jerry Snitselaar <jsnitsel at redhat.com>
Acked-by: Lu Baolu <baolu.lu at linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel at suse.de>
(cherry picked from commit 1ddb32da4a629fa7f87873d0b6836c2e1feb7518)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 drivers/iommu/intel-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0067bc2faf1b..ebb874fe6dbb 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2801,7 +2801,7 @@ static int identity_mapping(struct device *dev)
 	struct device_domain_info *info;
 
 	info = dev->archdata.iommu;
-	if (info && info != DUMMY_DEVICE_DOMAIN_INFO && info != DEFER_DEVICE_DOMAIN_INFO)
+	if (info)
 		return (info->domain == si_domain);
 
 	return 0;
-- 
2.17.1




More information about the kernel-team mailing list