Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1646720
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Peter Xu <peterx@redhat.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] iommu/vt-d: unwrap __get_valid_domain_for_dev() |
| Date | Mon, 22 May 2017 12:40:03 +0200 |
| Message-ID | <tJSUP-4wq-41@gated-at.bofh.it> (permalink) |
| Dmarc-Filter | OpenDMARC Filter v1.3.2 mx1.redhat.com 91D8D7D0CE |
| Authentication-Results | ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com |
| Authentication-Results | ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com |
| Dkim-Filter | OpenDKIM Filter v2.11.0 mx1.redhat.com 91D8D7D0CE |
| X-Scanned-By | MIMEDefang 2.79 on 10.5.11.13 |
| X-Greylist | Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 22 May 2017 10:29:02 +0000 (UTC) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 51 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Joerg Roedel <joro@8bytes.org>, linux-kernel@vger.kernel.org, peterx@redhat.com, David Woodhouse <dwmw2@infradead.org> |
| X-Original-Date | Mon, 22 May 2017 18:28:51 +0800 |
| X-Original-Message-ID | <1495448931-20382-1-git-send-email-peterx@redhat.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1646720 |
Show key headers only | View raw
We do find_domain() in __get_valid_domain_for_dev(), while we do the
same thing in get_valid_domain_for_dev(). No need to do it twice.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
drivers/iommu/intel-iommu.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index fc2765c..cb96f1c 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2390,7 +2390,7 @@ static struct dmar_domain *find_domain(struct device *dev)
/* No lock here, assumes no domain exit in normal case */
info = dev->archdata.iommu;
- if (info)
+ if (likely(info))
return info->domain;
return NULL;
}
@@ -3478,7 +3478,7 @@ static unsigned long intel_alloc_iova(struct device *dev,
return iova_pfn;
}
-static struct dmar_domain *__get_valid_domain_for_dev(struct device *dev)
+static struct dmar_domain *get_valid_domain_for_dev(struct device *dev)
{
struct dmar_domain *domain, *tmp;
struct dmar_rmrr_unit *rmrr;
@@ -3525,18 +3525,6 @@ static struct dmar_domain *__get_valid_domain_for_dev(struct device *dev)
return domain;
}
-static inline struct dmar_domain *get_valid_domain_for_dev(struct device *dev)
-{
- struct device_domain_info *info;
-
- /* No lock here, assumes no domain exit in normal case */
- info = dev->archdata.iommu;
- if (likely(info))
- return info->domain;
-
- return __get_valid_domain_for_dev(dev);
-}
-
/* Check if the dev needs to go through non-identity map and unmap process.*/
static int iommu_no_mapping(struct device *dev)
{
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] iommu/vt-d: unwrap __get_valid_domain_for_dev() Peter Xu <peterx@redhat.com> - 2017-05-22 12:40 +0200
csiph-web