* [PATCH] shrink drivers/pci/proc.c::pci_seq_start()
@ 2005-03-27 14:05 Rolf Eike Beer
2005-03-28 23:00 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Rolf Eike Beer @ 2005-03-27 14:05 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, linux-pci
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-kernel@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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] shrink drivers/pci/proc.c::pci_seq_start()
2005-03-27 14:05 [PATCH] shrink drivers/pci/proc.c::pci_seq_start() Rolf Eike Beer
@ 2005-03-28 23:00 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-03-28 23:00 UTC (permalink / raw)
To: Rolf Eike Beer; +Cc: linux-kernel, linux-pci
On Sun, Mar 27, 2005 at 03:05:43PM +0100, Rolf Eike Beer wrote:
> 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-kernel@sf-tec.de>
Applied, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-03-28 23:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-27 14:05 [PATCH] shrink drivers/pci/proc.c::pci_seq_start() Rolf Eike Beer
2005-03-28 23:00 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox