2020-02-17 19:42:32

by Joerg Roedel

[permalink] [raw]
Subject: [PATCH 5/5] iommu/vt-d: Simplify check in identity_mapping()

From: Joerg Roedel <[email protected]>

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.

Signed-off-by: Joerg Roedel <[email protected]>
---
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 16e47ca505eb..0b5a0fadbc0c 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2916,7 +2916,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


2020-02-17 19:55:47

by Jerry Snitselaar

[permalink] [raw]
Subject: Re: [PATCH 5/5] iommu/vt-d: Simplify check in identity_mapping()

On Mon Feb 17 20, Joerg Roedel wrote:
>From: Joerg Roedel <[email protected]>
>
>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.
>
>Signed-off-by: Joerg Roedel <[email protected]>

Reviewed-by: Jerry Snitselaar <[email protected]>