Rolf Eike Beer
2005-03-27 19:17:09 UTC
Hi,
this patch shrinks pci_seq_start by using for_each_pci_dev() macro instead
of explicitely using a loop and avoiding a goto.
Eike
Signed-off-by: Rolf Eike Beer <eike-***@sf-tec.de>
--- linux-2.6.11/drivers/pci/proc.c 2005-03-21 11:41:56.000000000 +0100
+++ linux-2.6.12-rc1/drivers/pci/proc.c 2005-03-27 16:03:10.000000000 +0200
@@ -313,13 +313,10 @@ static void *pci_seq_start(struct seq_fi
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
this patch shrinks pci_seq_start by using for_each_pci_dev() macro instead
of explicitely using a loop and avoiding a goto.
Eike
Signed-off-by: Rolf Eike Beer <eike-***@sf-tec.de>
--- linux-2.6.11/drivers/pci/proc.c 2005-03-21 11:41:56.000000000 +0100
+++ linux-2.6.12-rc1/drivers/pci/proc.c 2005-03-27 16:03:10.000000000 +0200
@@ -313,13 +313,10 @@ static void *pci_seq_start(struct seq_fi
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------