diff options
author | se <se@FreeBSD.org> | 1995-07-27 21:38:45 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1995-07-27 21:38:45 +0000 |
commit | 648aadf62b101973c3288a3053fe836a2c6e6c08 (patch) | |
tree | 526765c8f116b103e6fa21c676e65da391ef9b97 /sys/dev/pci | |
parent | c8aea2c1cf3555e314d36291b7a046abbaba0f30 (diff) | |
download | FreeBSD-src-648aadf62b101973c3288a3053fe836a2c6e6c08.zip FreeBSD-src-648aadf62b101973c3288a3053fe836a2c6e6c08.tar.gz |
Get rid of references to the linker supplied set length field.
Use the terminating NULL pointer as the end of list marker instead.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/pci.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 9536568..ee6454c 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pci.c,v 1.24 1995/06/28 15:59:04 se Exp $ +** $Id: pci.c,v 1.25 1995/06/28 16:32:54 se Exp $ ** ** General subroutines for the PCI bus. ** pci_configure () @@ -179,17 +179,16 @@ static struct pcicb *pcicb; void pci_configure() { - int i; + struct pcibus **pbp = (struct pcibus**) pcibus_set.ls_items; /* ** check pci bus present */ - for (i=0; i<pcibus_set.ls_length; i++) { - if (pci_maxdevice) break; - pcibus = (struct pcibus*) pcibus_set.ls_items[i]; - pcibus->pb_setup (); + while (!pci_maxdevice && (pcibus = *pbp++)) { + (*pcibus->pb_setup)(); } + if (!pci_maxdevice) return; /* @@ -353,10 +352,8 @@ pci_bus_config (void) int unit; int pciint; int irq; - char* name=0; - int dvi; - struct pci_device *dvp=0; + struct pci_device *dvp; struct pci_devconf *pdcp; @@ -375,6 +372,8 @@ pci_bus_config (void) }; #endif for (device=0; device<pci_maxdevice; device ++) { + char* name; + struct pci_device **dvpp; if ((pcicb->pcicb_seen >> device) & 1) continue; @@ -388,13 +387,14 @@ pci_bus_config (void) ** lookup device in ioconfiguration: */ - for (dvi=0; dvi<pcidevice_set.ls_length; dvi++) { - dvp = (struct pci_device*) pcidevice_set.ls_items[dvi]; - if ((name=(*dvp->pd_probe)(tag, type))) - break; - dvp = NULL; - }; + dvpp = (struct pci_device **)pcidevice_set.ls_items; + while (dvp = *dvpp++) { + if (dvp->pd_probe) { + if (name=(*dvp->pd_probe)(tag, type)) + break; + } + }; /* ** check for mirrored devices. */ |