From 54a2163437319ee25fa00aa0f2d1602eaac59945 Mon Sep 17 00:00:00 2001 From: Stefan Eßer Date: Thu, 27 Jul 1995 21:38:45 +0000 Subject: Get rid of references to the linker supplied set length field. Use the terminating NULL pointer as the end of list marker instead. --- sys/dev/pci/pci.c | 30 +++++++++++++++--------------- sys/pci/pci.c | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 9536568be9d5..ee6454cbe891 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; ipb_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; devicepcicb_seen >> device) & 1) continue; @@ -388,13 +387,14 @@ pci_bus_config (void) ** lookup device in ioconfiguration: */ - for (dvi=0; dvipd_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. */ diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 9536568be9d5..ee6454cbe891 100644 --- a/sys/pci/pci.c +++ b/sys/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; ipb_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; devicepcicb_seen >> device) & 1) continue; @@ -388,13 +387,14 @@ pci_bus_config (void) ** lookup device in ioconfiguration: */ - for (dvi=0; dvipd_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. */ -- cgit v1.3