On Thu, Jun 05, 2003 at 09:59:38AM +0100, Dave Jones wrote:
> On Thu, Jun 05, 2003 at 01:49:33AM -0700, Greg KH wrote:
>
> > > - pci_for_each_dev(device)
> > > + while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
> > >
> > > when you could have just added whatever locking pci_find_device() does
> > > to pci_for_each_dev() You'd then not have had to touch any of these
> > > drivers, and it'd look a damn sight better to look at IMO.
> >
> > pci_for_each_dev() is currently a macro, not a function, and I'm trying
> > to get rid of all public access to the pci lists. The majority of pci
> > drivers use the pci_find_device() function in just the way that I
> > converted the few remaining users of pci_for_each_dev() to (yeah, "few"
> > is a relative number, but check out how many people call
> > pci_find_device()...)
> >
> > I guess I could create this to clean it up a bit:
> > #define pci_find_all_devices(dev) pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)
> >
> > but that's really not that much of a change...
>
> so why not..
>
> #define pci_for_each_dev(dev) \
> while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
>
> ?
>
> Seems to be the same change you made tree-wide, with minimal
> interruption to drivers.
But that would have changed the way that pci_for_each_dev() works. It
would require that dev=NULL before the function is called. And having
the same function work subtly different on different kernel versions
would not be the best thing. Getting rid of it entirely was the better
option, and now that Linus has pulled it, we don't have to worry about
it anymore :)
thanks,
greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:26 EST