Patchwork [v2,15/16] sgi-agp: Use list_for_each_entry() for bus->devices traversal

login
register
mail settings
Submitter Bjorn Helgaas
Date Aug. 17, 2012, 11:37 p.m.
Message ID <20120817233702.10973.8426.stgit@bhelgaas.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/178420/
State Superseded
Headers show

Comments

Bjorn Helgaas - Aug. 17, 2012, 11:37 p.m.
Replace list_for_each() + pci_dev_b() with the simpler
list_for_each_entry().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: David Airlie <airlied@linux.ie>
---
 drivers/char/agp/sgi-agp.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index 1920003..3a5af2f 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -289,12 +289,11 @@  static int __devinit agp_sgi_init(void)
 
 	j = 0;
 	list_for_each_entry(info, &tioca_list, ca_list) {
-		struct list_head *tmp;
 		if (list_empty(info->ca_devices))
 			continue;
-		list_for_each(tmp, info->ca_devices) {
+		list_for_each_entry(pdev, info->ca_devices, bus_list) {
 			u8 cap_ptr;
-			pdev = pci_dev_b(tmp);
+
 			if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8))
 				continue;
 			cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);