From: Joerg Roedel Date: Mon, 17 Feb 2020 16:29:55 +0000 (+0100) Subject: iommu/vt-d: Simplify check in identity_mapping() X-Git-Tag: v5.5.7~145 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=66a17bf4756d6b4f30c969293ec23cf89995c7cf;p=users%2Fdwmw2%2Flinux.git iommu/vt-d: Simplify check in identity_mapping() commit 1ddb32da4a629fa7f87873d0b6836c2e1feb7518 upstream. 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@vger.kernel.org # v5.5 Reviewed-by: Jerry Snitselaar Acked-by: Lu Baolu Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 820d2fd48abc3..e7fc9e928788c 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -2799,7 +2799,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;