aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2014-03-09 16:55:54 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2014-03-24 10:07:46 -0400
commit41e80dca52bd0497c1bb292713fc0164415e9ae6 (patch)
tree834059710a0a9917486462699374a162bed6d7da /drivers/iommu
parent67ccac41fafda88492620f4c0a30d4ccb2eb7767 (diff)
iommu/vt-d: Remove segment from struct device_domain_info()
It's accessible via info->iommu->segment so this is redundant. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index aa8548c8a915..5c89eb7ae398 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -369,7 +369,6 @@ struct dmar_domain {
369struct device_domain_info { 369struct device_domain_info {
370 struct list_head link; /* link to domain siblings */ 370 struct list_head link; /* link to domain siblings */
371 struct list_head global; /* link to global list */ 371 struct list_head global; /* link to global list */
372 int segment; /* PCI domain */
373 u8 bus; /* PCI bus number */ 372 u8 bus; /* PCI bus number */
374 u8 devfn; /* PCI devfn number */ 373 u8 devfn; /* PCI devfn number */
375 struct device *dev; /* it's NULL for PCIe-to-PCI bridge */ 374 struct device *dev; /* it's NULL for PCIe-to-PCI bridge */
@@ -2136,7 +2135,7 @@ dmar_search_domain_by_dev_info(int segment, int bus, int devfn)
2136 struct device_domain_info *info; 2135 struct device_domain_info *info;
2137 2136
2138 list_for_each_entry(info, &device_domain_list, global) 2137 list_for_each_entry(info, &device_domain_list, global)
2139 if (info->segment == segment && info->bus == bus && 2138 if (info->iommu->segment == segment && info->bus == bus &&
2140 info->devfn == devfn) 2139 info->devfn == devfn)
2141 return info; 2140 return info;
2142 2141
@@ -2144,7 +2143,7 @@ dmar_search_domain_by_dev_info(int segment, int bus, int devfn)
2144} 2143}
2145 2144
2146static struct dmar_domain *dmar_insert_dev_info(struct intel_iommu *iommu, 2145static struct dmar_domain *dmar_insert_dev_info(struct intel_iommu *iommu,
2147 int segment, int bus, int devfn, 2146 int bus, int devfn,
2148 struct device *dev, 2147 struct device *dev,
2149 struct dmar_domain *domain) 2148 struct dmar_domain *domain)
2150{ 2149{
@@ -2156,7 +2155,6 @@ static struct dmar_domain *dmar_insert_dev_info(struct intel_iommu *iommu,
2156 if (!info) 2155 if (!info)
2157 return NULL; 2156 return NULL;
2158 2157
2159 info->segment = segment;
2160 info->bus = bus; 2158 info->bus = bus;
2161 info->devfn = devfn; 2159 info->devfn = devfn;
2162 info->dev = dev; 2160 info->dev = dev;
@@ -2170,7 +2168,7 @@ static struct dmar_domain *dmar_insert_dev_info(struct intel_iommu *iommu,
2170 found = find_domain(dev); 2168 found = find_domain(dev);
2171 else { 2169 else {
2172 struct device_domain_info *info2; 2170 struct device_domain_info *info2;
2173 info2 = dmar_search_domain_by_dev_info(segment, bus, devfn); 2171 info2 = dmar_search_domain_by_dev_info(iommu->segment, bus, devfn);
2174 if (info2) 2172 if (info2)
2175 found = info2->domain; 2173 found = info2->domain;
2176 } 2174 }
@@ -2250,14 +2248,14 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw)
2250 2248
2251 /* register pcie-to-pci device */ 2249 /* register pcie-to-pci device */
2252 if (dev_tmp) { 2250 if (dev_tmp) {
2253 domain = dmar_insert_dev_info(iommu, segment, bus, devfn, NULL, 2251 domain = dmar_insert_dev_info(iommu, bus, devfn, NULL,
2254 domain); 2252 domain);
2255 if (!domain) 2253 if (!domain)
2256 goto error; 2254 goto error;
2257 } 2255 }
2258 2256
2259found_domain: 2257found_domain:
2260 domain = dmar_insert_dev_info(iommu, segment, pdev->bus->number, 2258 domain = dmar_insert_dev_info(iommu, pdev->bus->number,
2261 pdev->devfn, &pdev->dev, domain); 2259 pdev->devfn, &pdev->dev, domain);
2262error: 2260error:
2263 if (free != domain) 2261 if (free != domain)
@@ -2468,8 +2466,7 @@ static int domain_add_dev_info(struct dmar_domain *domain,
2468 if (!iommu) 2466 if (!iommu)
2469 return -ENODEV; 2467 return -ENODEV;
2470 2468
2471 ndomain = dmar_insert_dev_info(iommu, pci_domain_nr(pdev->bus), 2469 ndomain = dmar_insert_dev_info(iommu, pdev->bus->number, pdev->devfn,
2472 pdev->bus->number, pdev->devfn,
2473 &pdev->dev, domain); 2470 &pdev->dev, domain);
2474 if (ndomain != domain) 2471 if (ndomain != domain)
2475 return -EBUSY; 2472 return -EBUSY;
@@ -4031,7 +4028,7 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain,
4031 4028
4032 spin_lock_irqsave(&device_domain_lock, flags); 4029 spin_lock_irqsave(&device_domain_lock, flags);
4033 list_for_each_entry_safe(info, tmp, &domain->devices, link) { 4030 list_for_each_entry_safe(info, tmp, &domain->devices, link) {
4034 if (info->segment == pci_domain_nr(pdev->bus) && 4031 if (info->iommu->segment == pci_domain_nr(pdev->bus) &&
4035 info->bus == pdev->bus->number && 4032 info->bus == pdev->bus->number &&
4036 info->devfn == pdev->devfn) { 4033 info->devfn == pdev->devfn) {
4037 unlink_domain_info(info); 4034 unlink_domain_info(info);