diff options
author | Yijing Wang <wangyijing@huawei.com> | 2013-10-31 05:26:04 -0400 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2013-11-01 09:18:48 -0400 |
commit | bca2b916f3d5c5bcb3d9d38fc1e4cb4d83b1d8a8 (patch) | |
tree | 7e117edf5ad3b985d486ff13253f56b79e10de9c /drivers/iommu | |
parent | 8b161f0ee911369232b5b5c18f84b5072f5bd09e (diff) |
iommu/vt-d: Use list_for_each_entry_safe() for dmar_domain->devices traversal
Replace list_for_each_safe() + list_entry() with the simpler
list_for_each_entry_safe().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 40203ada635e..43b9bfea48fa 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -3781,11 +3781,10 @@ static void iommu_detach_dependent_devices(struct intel_iommu *iommu, | |||
3781 | static void domain_remove_one_dev_info(struct dmar_domain *domain, | 3781 | static void domain_remove_one_dev_info(struct dmar_domain *domain, |
3782 | struct pci_dev *pdev) | 3782 | struct pci_dev *pdev) |
3783 | { | 3783 | { |
3784 | struct device_domain_info *info; | 3784 | struct device_domain_info *info, *tmp; |
3785 | struct intel_iommu *iommu; | 3785 | struct intel_iommu *iommu; |
3786 | unsigned long flags; | 3786 | unsigned long flags; |
3787 | int found = 0; | 3787 | int found = 0; |
3788 | struct list_head *entry, *tmp; | ||
3789 | 3788 | ||
3790 | iommu = device_to_iommu(pci_domain_nr(pdev->bus), pdev->bus->number, | 3789 | iommu = device_to_iommu(pci_domain_nr(pdev->bus), pdev->bus->number, |
3791 | pdev->devfn); | 3790 | pdev->devfn); |
@@ -3793,8 +3792,7 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain, | |||
3793 | return; | 3792 | return; |
3794 | 3793 | ||
3795 | spin_lock_irqsave(&device_domain_lock, flags); | 3794 | spin_lock_irqsave(&device_domain_lock, flags); |
3796 | list_for_each_safe(entry, tmp, &domain->devices) { | 3795 | list_for_each_entry_safe(info, tmp, &domain->devices, link) { |
3797 | info = list_entry(entry, struct device_domain_info, link); | ||
3798 | if (info->segment == pci_domain_nr(pdev->bus) && | 3796 | if (info->segment == pci_domain_nr(pdev->bus) && |
3799 | info->bus == pdev->bus->number && | 3797 | info->bus == pdev->bus->number && |
3800 | info->devfn == pdev->devfn) { | 3798 | info->devfn == pdev->devfn) { |