Skip to contentSkip to conversation

arch/x86/kernel: use for_each_pci_dev()

PATCH Applied Kulikov Vasiliy 2 participants 2 messages Jul 3, 2010 – Jul 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/19 arch/x86/kernel: use for_each_pci_dev()

Use for_each_pci_dev() to simplify the code.

---
 arch/x86/kernel/amd_iommu.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/kernel/amd_iommu.c +1 -2
index 0d20286..29dd3b9 100644
@@ -2609,8 +2609,7 @@ int __init amd_iommu_init_passthrough(void)
 
 	pt_domain->mode |= PAGE_MODE_NONE;
 
-	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
-
+	for_each_pci_dev(dev) {
 		if (!check_device(&dev->dev))
 			continue;
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 12 lines · Kulikov Vasiliy

Use for_each_pci_dev() to simplify the code.

---
 arch/x86/kernel/amd_iommu.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/kernel/amd_iommu.c +0 -0
index 0d20286..29dd3b9 100644

arch/x86/kernel/amd_iommu.c int __init amd_iommu_init_passthrough(void) · line 2614

Quoted 8 lines
arch/x86/kernel/amd_iommu.c +1 -2
@@ -2609,8 +2609,7 @@ int __init amd_iommu_init_passthrough(void)
 
 	pt_domain->mode |= PAGE_MODE_NONE;
 
-	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
-
+	for_each_pci_dev(dev) {
 		if (!check_device(&dev->dev))
 			continue;

Applied, thanks.

Signature · 5 lines
Joerg Roedel - AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632