Skip to content

Commit

Permalink
sgi-agp: Use list_for_each_entry() for bus->devices traversal
Browse files Browse the repository at this point in the history
Replace list_for_each() + pci_dev_b() with the simpler
list_for_each_entry().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
CC: David Airlie <airlied@linux.ie>
  • Loading branch information
Bjorn Helgaas committed Aug 22, 2012
1 parent 0b79ca2 commit 0a4af14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/char/agp/sgi-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0a4af14

Please sign in to comment.