[PATCH] PCI: shrink drivers/pci/proc.c::pci_seq_start()

Greg KH
2005-04-02T00:13:07Z

ChangeSet 1.2181.16.21, 2005/03/28 15:10:34-08:00, eike-kernel@sf-tec.de

[PATCH] PCI: shrink drivers/pci/proc.c::pci_seq_start()

this patch shrinks pci_seq_start by using for_each_pci_dev() macro instead
of explicitely using a loop and avoiding a goto.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

drivers/pci/proc.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)

diff -Nru a/drivers/pci/proc.c b/drivers/pci/proc.c
--- a/drivers/pci/proc.c 2005-04-01 15:32:36 -08:00
+++ b/drivers/pci/proc.c 2005-04-01 15:32:36 -08:00
@@ -313,13 +313,10 @@
struct pci_dev *dev = NULL;
loff_t n = *pos;

- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
- while (n--) {
- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
- if (dev == NULL)
- goto exit;
+ for_each_pci_dev(dev) {
+ if (!n--)
+ break;
}
-exit:
return dev;
}