diff options
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ata/ata_raid.c | 20 | ||||
| -rw-r--r-- | sys/dev/cardbus/cardbus.c | 20 | ||||
| -rw-r--r-- | sys/dev/eisa/eisa.c | 16 | ||||
| -rw-r--r-- | sys/dev/i2o/iop.c | 24 | ||||
| -rw-r--r-- | sys/dev/ic/aac.c | 24 | ||||
| -rw-r--r-- | sys/dev/ic/cac.c | 16 | ||||
| -rw-r--r-- | sys/dev/ic/i82365.c | 22 | ||||
| -rw-r--r-- | sys/dev/ic/icp.c | 29 | ||||
| -rw-r--r-- | sys/dev/ic/mlx.c | 18 | ||||
| -rw-r--r-- | sys/dev/ic/tcic2.c | 22 | ||||
| -rw-r--r-- | sys/dev/ic/upc.c | 24 | ||||
| -rw-r--r-- | sys/dev/ieee1394/firewire.c | 8 | ||||
| -rw-r--r-- | sys/dev/isa/isa.c | 40 | ||||
| -rw-r--r-- | sys/dev/mca/edc_mca.c | 16 | ||||
| -rw-r--r-- | sys/dev/mca/mca.c | 18 | ||||
| -rw-r--r-- | sys/dev/mii/mii.c | 16 | ||||
| -rw-r--r-- | sys/dev/pci/amr.c | 16 | ||||
| -rw-r--r-- | sys/dev/pci/pci.c | 20 | ||||
| -rw-r--r-- | sys/dev/pci/puc.c | 16 | ||||
| -rw-r--r-- | sys/dev/pci/twe.c | 16 | ||||
| -rw-r--r-- | sys/dev/pckbport/pckbport.c | 16 | ||||
| -rw-r--r-- | sys/dev/pcmcia/pcmcia.c | 20 | ||||
| -rw-r--r-- | sys/dev/pcmcia/pcmcom.c | 18 | ||||
| -rw-r--r-- | sys/dev/scsipi/scsiconf.c | 22 | ||||
| -rw-r--r-- | sys/dev/tc/ioasic_subr.c | 16 | ||||
| -rw-r--r-- | sys/dev/tc/tc.c | 29 | ||||
| -rw-r--r-- | sys/dev/tc/tcds.c | 18 | ||||
| -rw-r--r-- | sys/dev/tc/zs_ioasic.c | 18 | ||||
| -rw-r--r-- | sys/dev/usb/uhidev.c | 18 |
29 files changed, 251 insertions, 325 deletions
diff --git a/sys/dev/ata/ata_raid.c b/sys/dev/ata/ata_raid.c index e02fae13c85..2c03cfe5b92 100644 --- a/sys/dev/ata/ata_raid.c +++ b/sys/dev/ata/ata_raid.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.14 2005/07/18 15:21:48 briggs Exp $ */ +/* $NetBSD: ata_raid.c,v 1.15 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.14 2005/07/18 15:21:48 briggs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.15 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -191,8 +191,7 @@ static void ataraid_attach(struct device *parent, struct device *self, void *aux) { struct ataraid_array_info *aai; - int help[3]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[ATARAIDCF_NLOCS]; /* * We're a pseudo-device, so we get to announce our own @@ -203,11 +202,10 @@ ataraid_attach(struct device *parent, struct device *self, void *aux) ataraid_array_info_count == 1 ? "" : "s"); TAILQ_FOREACH(aai, &ataraid_array_info_list, aai_list) { - ldesc->len = 2; - ldesc->locs[ATARAIDCF_VENDTYPE] = aai->aai_type; - ldesc->locs[ATARAIDCF_UNIT] = aai->aai_arrayno; + locs[ATARAIDCF_VENDTYPE] = aai->aai_type; + locs[ATARAIDCF_UNIT] = aai->aai_arrayno; - config_found_sm_loc(self, "ataraid", NULL, aai, + config_found_sm_loc(self, "ataraid", locs, aai, ataraid_print, ataraid_submatch); } } @@ -235,15 +233,15 @@ ataraid_print(void *aux, const char *pnp) */ static int ataraid_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[ATARAIDCF_VENDTYPE] != ATARAIDCF_VENDTYPE_DEFAULT && - cf->cf_loc[ATARAIDCF_VENDTYPE] != ldesc->locs[ATARAIDCF_VENDTYPE]) + cf->cf_loc[ATARAIDCF_VENDTYPE] != locs[ATARAIDCF_VENDTYPE]) return (0); if (cf->cf_loc[ATARAIDCF_UNIT] != ATARAIDCF_UNIT_DEFAULT && - cf->cf_loc[ATARAIDCF_UNIT] != ldesc->locs[ATARAIDCF_UNIT]) + cf->cf_loc[ATARAIDCF_UNIT] != locs[ATARAIDCF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index ca27ba13e8c..7a144fee593 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: cardbus.c,v 1.61 2005/02/27 00:26:59 perry Exp $ */ +/* $NetBSD: cardbus.c,v 1.62 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 1997, 1998, 1999 and 2000 @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.61 2005/02/27 00:26:59 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.62 2005/08/25 18:35:39 drochner Exp $"); #include "opt_cardbus.h" @@ -477,8 +477,7 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators) for (function = 0; function < nfunction; function++) { struct cardbus_attach_args ca; - int help[3]; - locdesc_t *ldesc = (void *)&help; /* XXX */ + int locs[CARDBUSCF_NLOCS]; if (locators[CARDBUSCF_FUNCTION] != CARDBUSCF_FUNCTION_DEFAULT && @@ -592,11 +591,10 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators) } } - ldesc->len = 2; - ldesc->locs[CARDBUSCF_DEV] = sc->sc_device; /* always 0 */ - ldesc->locs[CARDBUSCF_FUNCTION] = function; + locs[CARDBUSCF_DEV] = sc->sc_device; /* always 0 */ + locs[CARDBUSCF_FUNCTION] = function; - if ((csc = config_found_sm_loc((void *)sc, "cardbus", ldesc, + if ((csc = config_found_sm_loc((void *)sc, "cardbus", locs, &ca, cardbusprint, cardbussubmatch)) == NULL) { /* do not match */ disable_function(sc, function); @@ -618,16 +616,16 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators) static int cardbussubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { /* ldesc->locs[CARDBUSCF_DEV] is always 0 */ if (cf->cf_loc[CARDBUSCF_DEV] != CARDBUSCF_DEV_DEFAULT && - cf->cf_loc[CARDBUSCF_DEV] != ldesc->locs[CARDBUSCF_DEV]) { + cf->cf_loc[CARDBUSCF_DEV] != locs[CARDBUSCF_DEV]) { return (0); } if (cf->cf_loc[CARDBUSCF_FUNCTION] != CARDBUSCF_FUNCTION_DEFAULT && - cf->cf_loc[CARDBUSCF_FUNCTION] != ldesc->locs[CARDBUSCF_FUNCTION]) { + cf->cf_loc[CARDBUSCF_FUNCTION] != locs[CARDBUSCF_FUNCTION]) { return (0); } diff --git a/sys/dev/eisa/eisa.c b/sys/dev/eisa/eisa.c index fe3151a4cfd..900a3a1d9d5 100644 --- a/sys/dev/eisa/eisa.c +++ b/sys/dev/eisa/eisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: eisa.c,v 1.36 2005/02/27 00:26:59 perry Exp $ */ +/* $NetBSD: eisa.c,v 1.37 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.36 2005/02/27 00:26:59 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.37 2005/08/25 18:35:39 drochner Exp $"); #include "opt_eisaverbose.h" @@ -90,11 +90,11 @@ eisaprint(void *aux, const char *pnp) static int eisasubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t * ldesc, void *aux) + const locdesc_t * locs, void *aux) { if (cf->cf_loc[EISACF_SLOT] != EISACF_SLOT_DEFAULT && - cf->cf_loc[EISACF_SLOT] != ldesc->locs[EISACF_SLOT]) + cf->cf_loc[EISACF_SLOT] != locs[EISACF_SLOT]) return (0); return (config_match(parent, cf, aux)); } @@ -128,8 +128,7 @@ eisaattach(struct device *parent, struct device *self, void *aux) u_int slotaddr; bus_space_handle_t slotioh; int i; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[EISACF_NLOCS]; ea.ea_iot = iot; ea.ea_memt = memt; @@ -192,11 +191,10 @@ eisaattach(struct device *parent, struct device *self, void *aux) /* We no longer need the I/O handle; free it. */ bus_space_unmap(iot, slotioh, EISA_SLOT_SIZE); - ldesc->len = 1; - ldesc->locs[EISACF_SLOT] = slot; + locs[EISACF_SLOT] = slot; /* Attach matching device. */ - config_found_sm_loc(self, "eisa", ldesc, &ea, + config_found_sm_loc(self, "eisa", locs, &ea, eisaprint, eisasubmatch); } } diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c index 217da22c0eb..b54a91964e5 100644 --- a/sys/dev/i2o/iop.c +++ b/sys/dev/i2o/iop.c @@ -1,4 +1,4 @@ -/* $NetBSD: iop.c,v 1.48 2005/05/30 04:37:42 christos Exp $ */ +/* $NetBSD: iop.c,v 1.49 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.48 2005/05/30 04:37:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.49 2005/08/25 18:35:39 drochner Exp $"); #include "opt_i2o.h" #include "iop.h" @@ -486,8 +486,7 @@ iop_config_interrupts(struct device *self) struct iop_softc *sc, *iop; struct i2o_systab_entry *ste; int rv, i, niop; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[IOPCF_NLOCS]; sc = (struct iop_softc *)self; LIST_INIT(&sc->sc_iilist); @@ -591,9 +590,8 @@ iop_config_interrupts(struct device *self) */ ia.ia_class = I2O_CLASS_ANY; ia.ia_tid = I2O_TID_IOP; - ldesc->len = 1; - ldesc->locs[IOPCF_TID] = I2O_TID_IOP; - config_found_sm_loc(self, "iop", ldesc, &ia, iop_print, iop_submatch); + locs[IOPCF_TID] = I2O_TID_IOP; + config_found_sm_loc(self, "iop", locs, &ia, iop_print, iop_submatch); /* * Start device configuration. @@ -803,8 +801,7 @@ iop_configure_devices(struct iop_softc *sc, int mask, int maskval) struct device *dv; int i, j, nent; u_int usertid; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[IOPCF_NLOCS]; nent = sc->sc_nlctent; for (i = 0, le = sc->sc_lct->entry; i < nent; i++, le++) { @@ -841,10 +838,9 @@ iop_configure_devices(struct iop_softc *sc, int mask, int maskval) if (ii != NULL) continue; - ldesc->len = 1; - ldesc->locs[IOPCF_TID] = ia.ia_tid; + locs[IOPCF_TID] = ia.ia_tid; - dv = config_found_sm_loc(&sc->sc_dv, "iop", ldesc, &ia, + dv = config_found_sm_loc(&sc->sc_dv, "iop", locs, &ia, iop_print, iop_submatch); if (dv != NULL) { sc->sc_tidmap[i].it_flags |= IT_CONFIGURED; @@ -904,11 +900,11 @@ iop_print(void *aux, const char *pnp) static int iop_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[IOPCF_TID] != IOPCF_TID_DEFAULT && - cf->cf_loc[IOPCF_TID] != ldesc->locs[IOPCF_TID]) + cf->cf_loc[IOPCF_TID] != locs[IOPCF_TID]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index 8c38c2b3da2..b30608f98bd 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $NetBSD: aac.c,v 1.21 2005/06/20 20:40:21 darcy Exp $ */ +/* $NetBSD: aac.c,v 1.22 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.21 2005/06/20 20:40:21 darcy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.22 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -154,13 +154,7 @@ aac_attach(struct aac_softc *sc) struct aac_ccb *ac; struct aac_fib *fib; bus_addr_t fibpa; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX - Not clean - The big plan is to let config(8) issue information - about the length of the locator array in a useful way. - Then the allocation can be centralized. See also - http://mail-index.netbsd.org/tech-kern/2005/02/09/0025.html - */ + int locs[AACCF_NLOCS]; SIMPLEQ_INIT(&sc->sc_ccb_free); SIMPLEQ_INIT(&sc->sc_ccb_queue); @@ -259,10 +253,9 @@ aac_attach(struct aac_softc *sc) continue; aaca.aaca_unit = i; - ldesc->len = 1; - ldesc->locs[AACCF_UNIT] = i; + locs[AACCF_UNIT] = i; - config_found_sm_loc(&sc->sc_dv, "aac", ldesc, &aaca, + config_found_sm_loc(&sc->sc_dv, "aac", locs, &aaca, aac_print, aac_submatch); } @@ -316,14 +309,11 @@ aac_print(void *aux, const char *pnp) */ static int aac_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { - struct aac_attach_args *aaca; - - aaca = aux; if (cf->cf_loc[AACCF_UNIT] != AACCF_UNIT_DEFAULT && - cf->cf_loc[AACCF_UNIT] != ldesc->locs[AACCF_UNIT]) + cf->cf_loc[AACCF_UNIT] != locs[AACCF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 50efd0e7673..cb00282f2cc 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $NetBSD: cac.c,v 1.30 2005/05/30 04:43:46 christos Exp $ */ +/* $NetBSD: cac.c,v 1.31 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.30 2005/05/30 04:43:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.31 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -101,8 +101,7 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw) int error, rseg, size, i; bus_dma_segment_t seg; struct cac_ccb *ccb; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[CACCF_NLOCS]; if (intrstr != NULL) aprint_normal("%s: interrupting at %s\n", sc->sc_dv.dv_xname, @@ -185,10 +184,9 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw) for (i = 0; i < cinfo.num_drvs; i++) { caca.caca_unit = i; - ldesc->len = 1; - ldesc->locs[CACCF_UNIT] = i; + locs[CACCF_UNIT] = i; - config_found_sm_loc(&sc->sc_dv, "cac", ldesc, &caca, + config_found_sm_loc(&sc->sc_dv, "cac", locs, &caca, cac_print, cac_submatch); } @@ -242,11 +240,11 @@ cac_print(void *aux, const char *pnp) */ static int cac_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[CACCF_UNIT] != CACCF_UNIT_DEFAULT && - cf->cf_loc[CACCF_UNIT] != ldesc->locs[CACCF_UNIT]) + cf->cf_loc[CACCF_UNIT] != locs[CACCF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c index 5b5d946c591..a51891f1ad9 100644 --- a/sys/dev/ic/i82365.c +++ b/sys/dev/ic/i82365.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82365.c,v 1.90 2005/05/30 04:43:46 christos Exp $ */ +/* $NetBSD: i82365.c,v 1.91 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 2004 Charles M. Hannum. All rights reserved. @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.90 2005/05/30 04:43:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.91 2005/08/25 18:35:39 drochner Exp $"); #define PCICDEBUG @@ -396,8 +396,7 @@ pcic_attach_socket(h) { struct pcmciabus_attach_args paa; struct pcic_softc *sc = (struct pcic_softc *)h->ph_parent; - int help[3]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[PCMCIABUSCF_NLOCS]; /* initialize the rest of the handle */ @@ -414,11 +413,10 @@ pcic_attach_socket(h) paa.iobase = sc->iobase; paa.iosize = sc->iosize; - ldesc->len = 2; - ldesc->locs[PCMCIABUSCF_CONTROLLER] = h->chip; - ldesc->locs[PCMCIABUSCF_SOCKET] = h->socket; + locs[PCMCIABUSCF_CONTROLLER] = h->chip; + locs[PCMCIABUSCF_SOCKET] = h->socket; - h->pcmcia = config_found_sm_loc(&sc->dev, "pcmciabus", ldesc, &paa, + h->pcmcia = config_found_sm_loc(&sc->dev, "pcmciabus", locs, &paa, pcic_print, pcic_submatch); if (h->pcmcia == NULL) { h->flags &= ~PCIC_FLAG_SOCKETP; @@ -642,18 +640,18 @@ pcic_event_thread(arg) } int -pcic_submatch(parent, cf, ldesc, aux) +pcic_submatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] != PCMCIABUSCF_CONTROLLER_DEFAULT && - cf->cf_loc[PCMCIABUSCF_CONTROLLER] != ldesc->locs[PCMCIABUSCF_CONTROLLER]) + cf->cf_loc[PCMCIABUSCF_CONTROLLER] != locs[PCMCIABUSCF_CONTROLLER]) return 0; if (cf->cf_loc[PCMCIABUSCF_SOCKET] != PCMCIABUSCF_SOCKET_DEFAULT && - cf->cf_loc[PCMCIABUSCF_SOCKET] != ldesc->locs[PCMCIABUSCF_SOCKET]) + cf->cf_loc[PCMCIABUSCF_SOCKET] != locs[PCMCIABUSCF_SOCKET]) return 0; return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/icp.c b/sys/dev/ic/icp.c index 3ceb352da33..940e5c75d8e 100644 --- a/sys/dev/ic/icp.c +++ b/sys/dev/ic/icp.c @@ -1,4 +1,4 @@ -/* $NetBSD: icp.c,v 1.14 2005/02/27 00:27:01 perry Exp $ */ +/* $NetBSD: icp.c,v 1.15 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -83,7 +83,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.14 2005/02/27 00:27:01 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.15 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -141,8 +141,7 @@ icp_init(struct icp_softc *icp, const char *intrstr) struct icp_ccb *ic; u_int16_t cdev_cnt; int i, j, state, feat, nsegs, rv; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[ICPCF_NLOCS]; state = 0; @@ -385,11 +384,10 @@ icp_init(struct icp_softc *icp, const char *intrstr) icpa.icpa_unit = j + ICPA_UNIT_SCSI; - ldesc->len = 1; - ldesc->locs[ICPCF_UNIT] = j + ICPA_UNIT_SCSI; + locs[ICPCF_UNIT] = j + ICPA_UNIT_SCSI; icp->icp_children[icpa.icpa_unit] = - config_found_sm_loc(&icp->icp_dv, "icp", ldesc, + config_found_sm_loc(&icp->icp_dv, "icp", locs, &icpa, icp_print, icp_submatch); } } @@ -404,11 +402,10 @@ icp_init(struct icp_softc *icp, const char *intrstr) icpa.icpa_unit = j; - ldesc->len = 1; - ldesc->locs[ICPCF_UNIT] = j; + locs[ICPCF_UNIT] = j; icp->icp_children[icpa.icpa_unit] = - config_found_sm_loc(&icp->icp_dv, "icp", ldesc, + config_found_sm_loc(&icp->icp_dv, "icp", locs, &icpa, icp_print, icp_submatch); } } @@ -457,8 +454,7 @@ icp_rescan(struct icp_softc *icp, int unit) { struct icp_attach_args icpa; u_int newsize, newtype; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[ICPCF_NLOCS]; /* * NOTE: It is very important that the queue be frozen and not @@ -531,11 +527,10 @@ icp_rescan(struct icp_softc *icp, int unit) icpa.icpa_unit = unit; - ldesc->len = 1; - ldesc->locs[ICPCF_UNIT] = unit; + locs[ICPCF_UNIT] = unit; icp->icp_children[unit] = config_found_sm_loc(&icp->icp_dv, - "icp", ldesc, &icpa, icp_print, icp_submatch); + "icp", locs, &icpa, icp_print, icp_submatch); } icp_recompute_openings(icp); @@ -649,11 +644,11 @@ icp_print(void *aux, const char *pnp) int icp_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[ICPCF_UNIT] != ICPCF_UNIT_DEFAULT && - cf->cf_loc[ICPCF_UNIT] != ldesc->locs[ICPCF_UNIT]) + cf->cf_loc[ICPCF_UNIT] != locs[ICPCF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/mlx.c b/sys/dev/ic/mlx.c index b6770bd82de..d5fda26844f 100644 --- a/sys/dev/ic/mlx.c +++ b/sys/dev/ic/mlx.c @@ -1,4 +1,4 @@ -/* $NetBSD: mlx.c,v 1.34 2005/07/30 17:37:11 mhitch Exp $ */ +/* $NetBSD: mlx.c,v 1.35 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.34 2005/07/30 17:37:11 mhitch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.35 2005/08/25 18:35:39 drochner Exp $"); #include "ld.h" @@ -577,8 +577,7 @@ mlx_configure(struct mlx_softc *mlx, int waitok) struct mlx_attach_args mlxa; int i, nunits; u_int size; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[MLXCF_NLOCS]; mlx->mlx_flags |= MLXF_RESCANNING; @@ -643,11 +642,10 @@ mlx_configure(struct mlx_softc *mlx, int waitok) */ mlxa.mlxa_unit = i; - ldesc->len = 1; - ldesc->locs[MLXCF_UNIT] = i; + locs[MLXCF_UNIT] = i; - ms->ms_dv = config_found_sm_loc(&mlx->mlx_dv, "mlx", NULL, &mlxa, mlx_print, - mlx_submatch); + ms->ms_dv = config_found_sm_loc(&mlx->mlx_dv, "mlx", locs, + &mlxa, mlx_print, mlx_submatch); nunits += (ms->ms_dv != NULL); } @@ -681,11 +679,11 @@ mlx_print(void *aux, const char *pnp) */ static int mlx_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[MLXCF_UNIT] != MLXCF_UNIT_DEFAULT && - cf->cf_loc[MLXCF_UNIT] != ldesc->locs[MLXCF_UNIT]) + cf->cf_loc[MLXCF_UNIT] != locs[MLXCF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/tcic2.c b/sys/dev/ic/tcic2.c index 4bcf668ea04..82f03761446 100644 --- a/sys/dev/ic/tcic2.c +++ b/sys/dev/ic/tcic2.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcic2.c,v 1.20 2005/05/30 04:43:47 christos Exp $ */ +/* $NetBSD: tcic2.c,v 1.21 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 1998, 1999 Christoph Badura. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.20 2005/05/30 04:43:47 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.21 2005/08/25 18:35:39 drochner Exp $"); #undef TCICDEBUG @@ -412,8 +412,7 @@ tcic_attach_socket(h) struct tcic_handle *h; { struct pcmciabus_attach_args paa; - int help[3]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[PCMCIABUSCF_NLOCS]; /* initialize the rest of the handle */ @@ -430,11 +429,10 @@ tcic_attach_socket(h) paa.iobase = h->sc->iobase; paa.iosize = h->sc->iosize; - ldesc->len = 2; - ldesc->locs[PCMCIABUSCF_CONTROLLER] = 0; - ldesc->locs[PCMCIABUSCF_SOCKET] = h->sock; + locs[PCMCIABUSCF_CONTROLLER] = 0; + locs[PCMCIABUSCF_SOCKET] = h->sock; - h->pcmcia = config_found_sm_loc(&h->sc->dev, "pcmciabus", ldesc, &paa, + h->pcmcia = config_found_sm_loc(&h->sc->dev, "pcmciabus", locs, &paa, tcic_print, tcic_submatch); /* if there's actually a pcmcia device attached, initialize the slot */ @@ -538,18 +536,18 @@ tcic_init_socket(h) } int -tcic_submatch(parent, cf, ldesc, aux) +tcic_submatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] != PCMCIABUSCF_CONTROLLER_DEFAULT && - cf->cf_loc[PCMCIABUSCF_CONTROLLER] != ldesc->locs[PCMCIABUSCF_CONTROLLER]) + cf->cf_loc[PCMCIABUSCF_CONTROLLER] != locs[PCMCIABUSCF_CONTROLLER]) return 0; if (cf->cf_loc[PCMCIABUSCF_SOCKET] != PCMCIABUSCF_SOCKET_DEFAULT && - cf->cf_loc[PCMCIABUSCF_SOCKET] != ldesc->locs[PCMCIABUSCF_SOCKET]) + cf->cf_loc[PCMCIABUSCF_SOCKET] != locs[PCMCIABUSCF_SOCKET]) return 0; return (config_match(parent, cf, aux)); diff --git a/sys/dev/ic/upc.c b/sys/dev/ic/upc.c index 92add4fa2e3..428a225ddc2 100644 --- a/sys/dev/ic/upc.c +++ b/sys/dev/ic/upc.c @@ -1,4 +1,4 @@ -/* $NetBSD: upc.c,v 1.9 2005/02/27 00:27:03 perry Exp $ */ +/* $NetBSD: upc.c,v 1.10 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2000, 2003 Ben Harris * All rights reserved. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: upc.c,v 1.9 2005/02/27 00:27:03 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: upc.c,v 1.10 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -211,8 +211,7 @@ upc_found(struct upc_softc *sc, char const *devtype, int offset, int size, struct upc_irqhandle *uih) { struct upc_attach_args ua; - int help[2]; - locdesc_t *ldesc = (void *)help; + int locs[UPCCF_NLOCS]; ua.ua_devtype = devtype; ua.ua_offset = offset; @@ -220,10 +219,9 @@ upc_found(struct upc_softc *sc, char const *devtype, int offset, int size, bus_space_subregion(sc->sc_iot, sc->sc_ioh, offset, size, &ua.ua_ioh); ua.ua_irqhandle = uih; - ldesc->len = 1; - ldesc->locs[UPCCF_OFFSET] = offset; + locs[UPCCF_OFFSET] = offset; - config_found_sm_loc(&sc->sc_dev, "upc", ldesc, &ua, + config_found_sm_loc(&sc->sc_dev, "upc", locs, &ua, upc_print, upc_submatch); } @@ -232,8 +230,7 @@ upc_found2(struct upc_softc *sc, char const *devtype, int offset, int size, int offset2, int size2, struct upc_irqhandle *uih) { struct upc_attach_args ua; - int help[2]; - locdesc_t *ldesc = (void *)help; + int locs[UPCCF_NLOCS]; ua.ua_devtype = devtype; ua.ua_offset = offset; @@ -243,10 +240,9 @@ upc_found2(struct upc_softc *sc, char const *devtype, int offset, int size, &ua.ua_ioh2); ua.ua_irqhandle = uih; - ldesc->len = 1; - ldesc->locs[UPCCF_OFFSET] = offset; + locs[UPCCF_OFFSET] = offset; - config_found_sm_loc(&sc->sc_dev, "upc", ldesc, &ua, + config_found_sm_loc(&sc->sc_dev, "upc", locs, &ua, upc_print, upc_submatch); } @@ -307,13 +303,13 @@ upc_print(void *aux, char const *pnp) static int upc_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { struct upc_attach_args *ua = aux; if (strcmp(cf->cf_name, ua->ua_devtype) == 0 && (cf->cf_loc[UPCCF_OFFSET] == UPCCF_OFFSET_DEFAULT || - cf->cf_loc[UPCCF_OFFSET] == ldesc->locs[UPCCF_OFFSET])) + cf->cf_loc[UPCCF_OFFSET] == locs[UPCCF_OFFSET])) return config_match(parent, cf, aux); return 0; } diff --git a/sys/dev/ieee1394/firewire.c b/sys/dev/ieee1394/firewire.c index c9a26e84b28..ef8bee5936d 100644 --- a/sys/dev/ieee1394/firewire.c +++ b/sys/dev/ieee1394/firewire.c @@ -1,4 +1,4 @@ -/* $NetBSD: firewire.c,v 1.2 2005/07/20 15:11:57 drochner Exp $ */ +/* $NetBSD: firewire.c,v 1.3 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2003 Hidetoshi Shimokawa * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa @@ -558,14 +558,14 @@ firewire_resume(device_t dev) #elif defined(__NetBSD__) static int firewiresubmatch( - struct device *parent, struct cfdata *cf, const locdesc_t *ldesc, void *aux) + struct device *parent, struct cfdata *cf, const locdesc_t *locs, void *aux) { if (cf->cf_loc[IEEE1394IFCF_EUIHI] != IEEE1394IFCF_EUIHI_DEFAULT && - cf->cf_loc[IEEE1394IFCF_EUIHI] != ldesc->locs[0]) + cf->cf_loc[IEEE1394IFCF_EUIHI] != locs[IEEE1394IFCF_EUIHI]) return (0); if (cf->cf_loc[IEEE1394IFCF_EUILO] != IEEE1394IFCF_EUILO_DEFAULT && - cf->cf_loc[IEEE1394IFCF_EUILO] != ldesc->locs[1]) + cf->cf_loc[IEEE1394IFCF_EUILO] != locs[IEEE1394IFCF_EUILO]) return (0); return (config_match(parent, cf, aux)); } diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c index 88e5f4ba113..ecd291cde7e 100644 --- a/sys/dev/isa/isa.c +++ b/sys/dev/isa/isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: isa.c,v 1.120 2005/05/29 22:12:37 christos Exp $ */ +/* $NetBSD: isa.c,v 1.121 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.120 2005/05/29 22:12:37 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isa.c,v 1.121 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -139,11 +139,9 @@ isaattach(struct device *parent, struct device *self, void *aux) int isarescan(struct device *self, const char *ifattr, const int *locators) { - int help[8]; - locdesc_t *ldesc = (void *)help; /* XXX */; + int locs[ISACF_NLOCS]; - ldesc->len = 7; - memcpy(&ldesc->locs, locators, 7 * sizeof(int)); + memcpy(locs, locators, sizeof(locs)); /* * XXX Bus independant code calling this function does not @@ -151,12 +149,12 @@ isarescan(struct device *self, const char *ifattr, const int *locators) * (should be made available by "config" one day) * So fixup where the "-1" is not correct. */ - if (ldesc->locs[ISACF_SIZE] == -1) - ldesc->locs[ISACF_SIZE] = ISACF_SIZE_DEFAULT; - if (ldesc->locs[ISACF_IOSIZ] == -1) - ldesc->locs[ISACF_IOSIZ] = ISACF_IOSIZ_DEFAULT; + if (locs[ISACF_SIZE] == -1) + locs[ISACF_SIZE] = ISACF_SIZE_DEFAULT; + if (locs[ISACF_IOSIZ] == -1) + locs[ISACF_IOSIZ] = ISACF_IOSIZ_DEFAULT; - config_search_loc(isasearch, self, ifattr, ldesc, NULL); + config_search_loc(isasearch, self, ifattr, locs, NULL); return (0); } @@ -390,8 +388,7 @@ isasearch(struct device *parent, struct cfdata *cf, struct isa_drq res_drq[2]; struct isa_softc *sc = (struct isa_softc *)parent; struct isa_attach_args ia; - int help[8]; - locdesc_t *locs = (void *)&help; /* XXX */ + int locs[ISACF_NLOCS]; int tryagain; do { @@ -427,7 +424,7 @@ isasearch(struct device *parent, struct cfdata *cf, ia.ia_drq = res_drq; ia.ia_ndrq = 2; - if (!checkattachargs(&ia, ldesc->locs)) + if (!checkattachargs(&ia, locs)) return (0); tryagain = 0; @@ -436,14 +433,13 @@ isasearch(struct device *parent, struct cfdata *cf, * This is not necessary for detach, but might * still be useful to collect device information. */ - locs->len = 7; - locs->locs[ISACF_PORT] = ia.ia_io[0].ir_addr; - locs->locs[ISACF_SIZE] = ia.ia_io[0].ir_size; - locs->locs[ISACF_IOMEM] = ia.ia_iomem[0].ir_addr; - locs->locs[ISACF_IOSIZ] = ia.ia_iomem[0].ir_size; - locs->locs[ISACF_IRQ] = ia.ia_irq[0].ir_irq; - locs->locs[ISACF_DRQ] = ia.ia_drq[0].ir_drq; - locs->locs[ISACF_DRQ2] = ia.ia_drq[1].ir_drq; + locs[ISACF_PORT] = ia.ia_io[0].ir_addr; + locs[ISACF_SIZE] = ia.ia_io[0].ir_size; + locs[ISACF_IOMEM] = ia.ia_iomem[0].ir_addr; + locs[ISACF_IOSIZ] = ia.ia_iomem[0].ir_size; + locs[ISACF_IRQ] = ia.ia_irq[0].ir_irq; + locs[ISACF_DRQ] = ia.ia_drq[0].ir_drq; + locs[ISACF_DRQ2] = ia.ia_drq[1].ir_drq; config_attach_loc(parent, cf, locs, &ia, isaprint); tryagain = (cf->cf_fstate == FSTATE_STAR); } diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c index 62a8c2ee2e4..687af9ae459 100644 --- a/sys/dev/mca/edc_mca.c +++ b/sys/dev/mca/edc_mca.c @@ -1,4 +1,4 @@ -/* $NetBSD: edc_mca.c,v 1.28 2005/02/27 00:27:21 perry Exp $ */ +/* $NetBSD: edc_mca.c,v 1.29 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.28 2005/02/27 00:27:21 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.29 2005/08/25 18:35:39 drochner Exp $"); #include "rnd.h" @@ -153,11 +153,11 @@ edc_mca_probe(parent, match, aux) static int edcsubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[EDCCF_DRIVE] != EDCCF_DRIVE_DEFAULT && - cf->cf_loc[EDCCF_DRIVE] != ldesc->locs[EDCCF_DRIVE]) + cf->cf_loc[EDCCF_DRIVE] != locs[EDCCF_DRIVE]) return (0); return (config_match(parent, cf, aux)); @@ -175,8 +175,7 @@ edc_mca_attach(parent, self, aux) int irq, drq, iobase; const char *typestr; int devno, error; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[EDCCF_NLOCS]; pos2 = mca_conf_read(ma->ma_mc, ma->ma_slot, 2); pos3 = mca_conf_read(ma->ma_mc, ma->ma_slot, 3); @@ -324,10 +323,9 @@ edc_mca_attach(parent, self, aux) /* check for attached disks */ for (devno = 0; devno < sc->sc_maxdevs; devno++) { eda.edc_drive = devno; - ldesc->len = 1; - ldesc->locs[EDCCF_DRIVE] = devno; + locs[EDCCF_DRIVE] = devno; sc->sc_ed[devno] = - (void *) config_found_sm_loc(self, "edc", ldesc, &eda, + (void *) config_found_sm_loc(self, "edc", locs, &eda, NULL, edcsubmatch); /* If initialization did not succeed, NULL the pointer. */ diff --git a/sys/dev/mca/mca.c b/sys/dev/mca/mca.c index caec15560d8..c5e13933524 100644 --- a/sys/dev/mca/mca.c +++ b/sys/dev/mca/mca.c @@ -1,4 +1,4 @@ -/* $NetBSD: mca.c,v 1.17 2005/02/04 02:10:43 perry Exp $ */ +/* $NetBSD: mca.c,v 1.18 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.17 2005/02/04 02:10:43 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.18 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -118,15 +118,15 @@ mca_print(aux, pnp) } int -mca_submatch(parent, cf, ldesc, aux) +mca_submatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { if (cf->cf_loc[MCACF_SLOT] != MCACF_SLOT_DEFAULT && - cf->cf_loc[MCACF_SLOT] != ldesc->locs[MCACF_SLOT]) + cf->cf_loc[MCACF_SLOT] != locs[MCACF_SLOT]) return 0; return (config_match(parent, cf, aux)); } @@ -162,8 +162,7 @@ mca_attach(parent, self, aux) for (slot = 0; slot < MCA_MAX_SLOTS; slot++) { struct mca_attach_args ma; int reg; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[MCACF_NLOCS]; ma.ma_iot = iot; ma.ma_memt = memt; @@ -178,12 +177,11 @@ mca_attach(parent, self, aux) if (ma.ma_id == 0xffff) /* no adapter here */ continue; - ldesc->len = 1; - ldesc->locs[MCACF_SLOT] = slot; + locs[MCACF_SLOT] = slot; if (ma.ma_pos[2] & MCA_POS2_ENABLE || mca_match_disabled(ma.ma_id)) - config_found_sm_loc(self, "mca", ldesc, &ma, + config_found_sm_loc(self, "mca", locs, &ma, mca_print, mca_submatch); else { mca_print(&ma, self->dv_xname); diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index fb2e5f830ed..36720eebbb6 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $NetBSD: mii.c,v 1.37 2004/09/13 12:55:48 drochner Exp $ */ +/* $NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.37 2004/09/13 12:55:48 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -74,8 +74,7 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask, struct mii_softc *child; int bmsr, offset = 0; int phymin, phymax; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[MIICF_NLOCS]; if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY) panic("mii_attach: phyloc and offloc specified"); @@ -144,11 +143,10 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask, ma.mii_capmask = capmask; ma.mii_flags = flags | (mii->mii_flags & MIIF_INHERIT_MASK); - ldesc->len = 1; - ldesc->locs[MIICF_PHY] = ma.mii_phyno; + locs[MIICF_PHY] = ma.mii_phyno; child = (struct mii_softc *)config_found_sm_loc(parent, "mii", - ldesc, &ma, mii_print, mii_submatch); + locs, &ma, mii_print, mii_submatch); if (child) { /* * Link it up in the parent's MII data. @@ -239,11 +237,11 @@ mii_print(void *aux, const char *pnp) static int mii_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[MIICF_PHY] != MIICF_PHY_DEFAULT && - cf->cf_loc[MIICF_PHY] != ldesc->locs[MIICF_PHY]) + cf->cf_loc[MIICF_PHY] != locs[MIICF_PHY]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/pci/amr.c b/sys/dev/pci/amr.c index ffc0ee6772d..a643d5c5c28 100644 --- a/sys/dev/pci/amr.c +++ b/sys/dev/pci/amr.c @@ -1,4 +1,4 @@ -/* $NetBSD: amr.c,v 1.27 2005/06/28 00:28:41 thorpej Exp $ */ +/* $NetBSD: amr.c,v 1.28 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.27 2005/06/28 00:28:41 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.28 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -257,8 +257,7 @@ amr_attach(struct device *parent, struct device *self, void *aux) pcireg_t reg; int rseg, i, j, size, rv, memreg, ioreg; struct amr_ccb *ac; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[AMRCF_NLOCS]; aprint_naive(": RAID controller\n"); @@ -464,11 +463,10 @@ amr_attach(struct device *parent, struct device *self, void *aux) continue; amra.amra_unit = j; - ldesc->len = 1; - ldesc->locs[AMRCF_UNIT] = j; + locs[AMRCF_UNIT] = j; amr->amr_drive[j].al_dv = config_found_sm_loc(&amr->amr_dv, - "amr", ldesc, &amra, amr_print, amr_submatch); + "amr", locs, &amra, amr_print, amr_submatch); } SIMPLEQ_INIT(&amr->amr_ccb_queue); @@ -539,14 +537,14 @@ amr_print(void *aux, const char *pnp) */ static int amr_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { struct amr_attach_args *amra; amra = (struct amr_attach_args *)aux; if (cf->cf_loc[AMRCF_UNIT] != AMRCF_UNIT_DEFAULT && - cf->cf_loc[AMRCF_UNIT] != ldesc->locs[AMRCF_UNIT]) + cf->cf_loc[AMRCF_UNIT] != locs[AMRCF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 96df3f9bdc3..12191a9e4f9 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci.c,v 1.93 2005/06/28 00:28:42 thorpej Exp $ */ +/* $NetBSD: pci.c,v 1.94 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.93 2005/06/28 00:28:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.94 2005/08/25 18:35:39 drochner Exp $"); #include "opt_pci.h" @@ -245,14 +245,14 @@ pciprint(void *aux, const char *pnp) int pcisubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[PCICF_DEV] != PCICF_DEV_DEFAULT && - cf->cf_loc[PCICF_DEV] != ldesc->locs[PCICF_DEV]) + cf->cf_loc[PCICF_DEV] != locs[PCICF_DEV]) return (0); if (cf->cf_loc[PCICF_FUNCTION] != PCICF_FUNCTION_DEFAULT && - cf->cf_loc[PCICF_FUNCTION] != ldesc->locs[PCICF_FUNCTION]) + cf->cf_loc[PCICF_FUNCTION] != locs[PCICF_FUNCTION]) return (0); return (config_match(parent, cf, aux)); } @@ -265,8 +265,7 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag, struct pci_attach_args pa; pcireg_t id, csr, class, intr, bhlcr; int ret, pin, bus, device, function; - int help[3]; - locdesc_t *ldp = (void *)&help; /* XXX XXX */ + int locs[PCICF_NLOCS]; struct device *subdev; pci_decompose_tag(pc, tag, &bus, &device, &function); @@ -350,11 +349,10 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag, if (ret != 0 && pap != NULL) *pap = pa; } else { - ldp->len = 2; - ldp->locs[PCICF_DEV] = device; - ldp->locs[PCICF_FUNCTION] = function; + locs[PCICF_DEV] = device; + locs[PCICF_FUNCTION] = function; - subdev = config_found_sm_loc(&sc->sc_dev, "pci", ldp, &pa, + subdev = config_found_sm_loc(&sc->sc_dev, "pci", locs, &pa, pciprint, pcisubmatch); sc->PCI_SC_DEVICESC(device, function) = subdev; ret = (subdev != NULL); diff --git a/sys/dev/pci/puc.c b/sys/dev/pci/puc.c index 87c643bb2a8..630fb066692 100644 --- a/sys/dev/pci/puc.c +++ b/sys/dev/pci/puc.c @@ -1,4 +1,4 @@ -/* $NetBSD: puc.c,v 1.24 2005/06/28 00:28:42 thorpej Exp $ */ +/* $NetBSD: puc.c,v 1.25 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 1996, 1998, 1999 @@ -53,7 +53,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: puc.c,v 1.24 2005/06/28 00:28:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puc.c,v 1.25 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -155,8 +155,7 @@ puc_attach(struct device *parent, struct device *self, void *aux) #ifdef PUCCN bus_space_handle_t ioh; #endif - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[PUCCF_NLOCS]; subsys = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG); sc->sc_desc = puc_find_description(PCI_VENDOR(pa->pa_id), @@ -301,11 +300,10 @@ puc_attach(struct device *parent, struct device *self, void *aux) (long)paa.t, (long)paa.h); #endif - ldesc->len = 1; - ldesc->locs[PUCCF_PORT] = i; + locs[PUCCF_PORT] = i; /* and configure it */ - sc->sc_ports[i].dev = config_found_sm_loc(self, "puc", ldesc, + sc->sc_ports[i].dev = config_found_sm_loc(self, "puc", locs, &paa, puc_print, puc_submatch); } } @@ -326,11 +324,11 @@ puc_print(void *aux, const char *pnp) static int puc_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[PUCCF_PORT] != PUCCF_PORT_DEFAULT && - cf->cf_loc[PUCCF_PORT] != ldesc->locs[PUCCF_PORT]) + cf->cf_loc[PUCCF_PORT] != locs[PUCCF_PORT]) return 0; return (config_match(parent, cf, aux)); diff --git a/sys/dev/pci/twe.c b/sys/dev/pci/twe.c index 14107a15626..55d9111a457 100644 --- a/sys/dev/pci/twe.c +++ b/sys/dev/pci/twe.c @@ -1,4 +1,4 @@ -/* $NetBSD: twe.c,v 1.68 2005/06/28 00:28:42 thorpej Exp $ */ +/* $NetBSD: twe.c,v 1.69 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 2000, 2001, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.68 2005/06/28 00:28:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.69 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -551,8 +551,7 @@ twe_add_unit(struct twe_softc *sc, int unit) int rv; uint16_t dsize; uint8_t newtype, newstripe; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[TWECF_NLOCS]; if (unit < 0 || unit >= TWE_MAX_UNITS) return (EINVAL); @@ -640,10 +639,9 @@ twe_add_unit(struct twe_softc *sc, int unit) twea.twea_unit = unit; - ldesc->len = 1; - ldesc->locs[TWECF_UNIT] = unit; + locs[TWECF_UNIT] = unit; - td->td_dev = config_found_sm_loc(&sc->sc_dv, "twe", NULL, &twea, + td->td_dev = config_found_sm_loc(&sc->sc_dv, "twe", locs, &twea, twe_print, twe_submatch); rv = 0; @@ -780,11 +778,11 @@ twe_print(void *aux, const char *pnp) */ static int twe_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[TWECF_UNIT] != TWECF_UNIT_DEFAULT && - cf->cf_loc[TWECF_UNIT] != ldesc->locs[TWECF_UNIT]) + cf->cf_loc[TWECF_UNIT] != locs[TWECF_UNIT]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/pckbport/pckbport.c b/sys/dev/pckbport/pckbport.c index 666a929e705..e2ff5603d87 100644 --- a/sys/dev/pckbport/pckbport.c +++ b/sys/dev/pckbport/pckbport.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbport.c,v 1.4 2004/09/13 12:55:48 drochner Exp $ */ +/* $NetBSD: pckbport.c,v 1.5 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 2004 Ben Harris @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbport.c,v 1.4 2004/09/13 12:55:48 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbport.c,v 1.5 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -120,11 +120,11 @@ pckbport_send_devcmd(struct pckbport_tag *t, pckbport_slot_t slot, u_char val) static int pckbport_submatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[PCKBPORTCF_SLOT] != PCKBPORTCF_SLOT_DEFAULT && - cf->cf_loc[PCKBPORTCF_SLOT] != ldesc->locs[PCKBPORTCF_SLOT]) + cf->cf_loc[PCKBPORTCF_SLOT] != locs[PCKBPORTCF_SLOT]) return 0; return config_match(parent, cf, aux); } @@ -152,8 +152,7 @@ pckbport_attach_slot(struct device *dev, pckbport_tag_t t, void *sdata; struct device *found; int alloced = 0; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[PCKBPORTCF_NLOCS]; pa.pa_tag = t; pa.pa_slot = slot; @@ -170,10 +169,9 @@ pckbport_attach_slot(struct device *dev, pckbport_tag_t t, alloced++; } - ldesc->len = 1; - ldesc->locs[PCKBPORTCF_SLOT] = slot; + locs[PCKBPORTCF_SLOT] = slot; - found = config_found_sm_loc(dev, "pckbport", ldesc, &pa, + found = config_found_sm_loc(dev, "pckbport", locs, &pa, pckbportprint, pckbport_submatch); if (found == NULL && alloced) { diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c index fc99a4ba4a5..1d655384bd0 100644 --- a/sys/dev/pcmcia/pcmcia.c +++ b/sys/dev/pcmcia/pcmcia.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcmcia.c,v 1.74 2005/08/15 18:58:24 christos Exp $ */ +/* $NetBSD: pcmcia.c,v 1.75 2005/08/25 18:35:39 drochner Exp $ */ /* * Copyright (c) 2004 Charles M. Hannum. All rights reserved. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.74 2005/08/15 18:58:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.75 2005/08/25 18:35:39 drochner Exp $"); #include "opt_pcmciaverbose.h" @@ -214,8 +214,7 @@ pcmcia_rescan(struct device *self, const char *ifattr, const int *locators) struct pcmcia_softc *sc = (struct pcmcia_softc *)self; struct pcmcia_function *pf; struct pcmcia_attach_args paa; - int help[3]; - locdesc_t *ldesc = (void *)&help; /* XXX */ + int locs[PCMCIACF_NLOCS]; if (sc->card.error || SIMPLEQ_EMPTY(&sc->card.pf_head)) { @@ -234,16 +233,15 @@ pcmcia_rescan(struct device *self, const char *ifattr, const int *locators) if (pf->child) continue; - ldesc->len = 2; - ldesc->locs[PCMCIACF_FUNCTION] = pf->number; - ldesc->locs[PCMCIACF_IRQ] = PCMCIACF_IRQ_DEFAULT; + locs[PCMCIACF_FUNCTION] = pf->number; + locs[PCMCIACF_IRQ] = PCMCIACF_IRQ_DEFAULT; paa.manufacturer = sc->card.manufacturer; paa.product = sc->card.product; paa.card = &sc->card; paa.pf = pf; - pf->child = config_found_sm_loc(self, "pcmcia", ldesc, &paa, + pf->child = config_found_sm_loc(self, "pcmcia", locs, &paa, pcmcia_print, pcmcia_submatch); } @@ -332,15 +330,15 @@ pcmcia_card_deactivate(dev) } int -pcmcia_submatch(parent, cf, ldesc, aux) +pcmcia_submatch(parent, cf, locs, aux) struct device *parent; - const locdesc_t *ldesc; + const locdesc_t *locs; struct cfdata *cf; void *aux; { if (cf->cf_loc[PCMCIACF_FUNCTION] != PCMCIACF_FUNCTION_DEFAULT && - cf->cf_loc[PCMCIACF_FUNCTION] != ldesc->locs[PCMCIACF_FUNCTION]) + cf->cf_loc[PCMCIACF_FUNCTION] != locs[PCMCIACF_FUNCTION]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/pcmcia/pcmcom.c b/sys/dev/pcmcia/pcmcom.c index d5916b8fe25..7952152d715 100644 --- a/sys/dev/pcmcia/pcmcom.c +++ b/sys/dev/pcmcia/pcmcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcmcom.c,v 1.22 2005/02/27 00:27:43 perry Exp $ */ +/* $NetBSD: pcmcom.c,v 1.23 2005/08/25 18:35:39 drochner Exp $ */ /*- * Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc. @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.22 2005/02/27 00:27:43 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.23 2005/08/25 18:35:39 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -154,8 +154,7 @@ pcmcom_attach(parent, self, aux) struct pcmcia_config_entry *cfe; int slave; int error; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[PCMCOMCF_NLOCS]; sc->sc_pf = pa->pf; @@ -183,11 +182,10 @@ pcmcom_attach(parent, self, aux) pca.pca_ioh = cfe->iospace[slave].handle.ioh; pca.pca_slave = slave; - ldesc->len = 1; - ldesc->locs[PCMCOMCF_SLAVE] = slave; + locs[PCMCOMCF_SLAVE] = slave; sc->sc_slaves[slave] = config_found_sm_loc(&sc->sc_dev, - "pcmcom", ldesc, + "pcmcom", locs, &pca, pcmcom_print, pcmcom_submatch); } @@ -275,15 +273,15 @@ pcmcom_print(aux, pnp) } int -pcmcom_submatch(parent, cf, ldesc, aux) +pcmcom_submatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { if (cf->cf_loc[PCMCOMCF_SLAVE] != PCMCOMCF_SLAVE_DEFAULT && - cf->cf_loc[PCMCOMCF_SLAVE] != ldesc->locs[PCMCOMCF_SLAVE]); + cf->cf_loc[PCMCOMCF_SLAVE] != locs[PCMCOMCF_SLAVE]); return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/scsipi/scsiconf.c b/sys/dev/scsipi/scsiconf.c index 25c7f582c1d..e5e625a5cc8 100644 --- a/sys/dev/scsipi/scsiconf.c +++ b/sys/dev/scsipi/scsiconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsiconf.c,v 1.230 2005/05/30 04:25:32 christos Exp $ */ +/* $NetBSD: scsiconf.c,v 1.231 2005/08/25 18:35:40 drochner Exp $ */ /*- * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.230 2005/05/30 04:25:32 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.231 2005/08/25 18:35:40 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -244,14 +244,14 @@ scsibus_config(struct scsipi_channel *chan, void *arg) static int scsibussubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if (cf->cf_loc[SCSIBUSCF_TARGET] != SCSIBUSCF_TARGET_DEFAULT && - cf->cf_loc[SCSIBUSCF_TARGET] != ldesc->locs[0]) + cf->cf_loc[SCSIBUSCF_TARGET] != locs[SCSIBUSCF_TARGET]) return (0); if (cf->cf_loc[SCSIBUSCF_LUN] != SCSIBUSCF_LUN_DEFAULT && - cf->cf_loc[SCSIBUSCF_LUN] != ldesc->locs[1]) + cf->cf_loc[SCSIBUSCF_LUN] != locs[SCSIBUSCF_LUN]) return (0); return (config_match(parent, cf, aux)); } @@ -739,8 +739,7 @@ scsi_probe_device(struct scsibus_softc *sc, int target, int lun) int checkdtype, priority, docontinue, quirks; struct scsipibus_attach_args sa; struct cfdata *cf; - int help[3]; - locdesc_t *locd = (void *)&help; + int locs[SCSIBUSCF_NLOCS]; struct device *chld; /* @@ -954,19 +953,18 @@ scsi_probe_device(struct scsibus_softc *sc, int target, int lun) if ((periph->periph_quirks & PQUIRK_NOLUNS) == 0) docontinue = 1; - locd->len = 2; - locd->locs[0] = target; - locd->locs[1] = lun; + locs[SCSIBUSCF_TARGET] = target; + locs[SCSIBUSCF_LUN] = lun; if ((cf = config_search_loc(scsibussubmatch, &sc->sc_dev, - "scsibus", locd, &sa)) != NULL) { + "scsibus", locs, &sa)) != NULL) { scsipi_insert_periph(chan, periph); /* * XXX Can't assign periph_dev here, because we'll * XXX need it before config_attach() returns. Must * XXX assign it in periph driver. */ - chld = config_attach_loc(&sc->sc_dev, cf, locd, &sa, + chld = config_attach_loc(&sc->sc_dev, cf, locs, &sa, scsibusprint); } else { scsibusprint(&sa, sc->sc_dev.dv_xname); diff --git a/sys/dev/tc/ioasic_subr.c b/sys/dev/tc/ioasic_subr.c index 2f8b146f483..1d4b2d9bd90 100644 --- a/sys/dev/tc/ioasic_subr.c +++ b/sys/dev/tc/ioasic_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: ioasic_subr.c,v 1.8 2005/02/27 00:27:49 perry Exp $ */ +/* $NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.8 2005/02/27 00:27:49 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -58,11 +58,11 @@ ioasicprint(aux, pnp) int ioasicsubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { if ((cf->cf_loc[IOASICCF_OFFSET] != IOASICCF_OFFSET_DEFAULT) && - (cf->cf_loc[IOASICCF_OFFSET] != ldesc->locs[IOASICCF_OFFSET])) + (cf->cf_loc[IOASICCF_OFFSET] != locs[IOASICCF_OFFSET])) return (0); return (config_match(parent, cf, aux)); @@ -76,8 +76,7 @@ ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs) { struct ioasicdev_attach_args idev; int i; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[IOASICCF_NLOCS]; /* * Try to configure each device. @@ -90,9 +89,8 @@ ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs) idev.iada_cookie = ioasic_devs[i].iad_cookie; /* Tell the autoconfig machinery we've found the hardware. */ - ldesc->len = 1; - ldesc->locs[IOASICCF_OFFSET] = ioasic_devs[i].iad_offset; - config_found_sm_loc(&sc->sc_dv, "ioasic", ldesc, &idev, + locs[IOASICCF_OFFSET] = ioasic_devs[i].iad_offset; + config_found_sm_loc(&sc->sc_dv, "ioasic", locs, &idev, ioasicprint, ioasicsubmatch); } } diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c index 56567cf5b6d..c29572a356d 100644 --- a/sys/dev/tc/tc.c +++ b/sys/dev/tc/tc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tc.c,v 1.40 2005/02/04 02:10:48 perry Exp $ */ +/* $NetBSD: tc.c,v 1.41 2005/08/25 18:35:40 drochner Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.40 2005/02/04 02:10:48 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.41 2005/08/25 18:35:40 drochner Exp $"); #include "opt_tcverbose.h" @@ -82,8 +82,7 @@ tcattach(parent, self, aux) struct tc_slotdesc *slot; tc_addr_t tcaddr; int i; - int help[3]; - locdesc_t *ldesc = (void *)&help; /* XXX */ + int locs[TCCF_NLOCS]; printf(": %s MHz clock\n", tba->tba_speed == TC_SPEED_25_MHZ ? "25" : "12.5"); @@ -136,13 +135,12 @@ tcattach(parent, self, aux) */ sc->sc_slots[builtin->tcb_slot].tcs_used = 1; - ldesc->len = 2; - ldesc->locs[TCCF_SLOT] = builtin->tcb_slot; - ldesc->locs[TCCF_OFFSET] = builtin->tcb_offset; + locs[TCCF_SLOT] = builtin->tcb_slot; + locs[TCCF_OFFSET] = builtin->tcb_offset; /* * Attach the device. */ - config_found_sm_loc(self, "tc", ldesc, &ta, + config_found_sm_loc(self, "tc", locs, &ta, tcprint, tcsubmatch); } @@ -180,13 +178,12 @@ tcattach(parent, self, aux) */ slot->tcs_used = 1; - ldesc->len = 2; - ldesc->locs[TCCF_SLOT] = i; - ldesc->locs[TCCF_OFFSET] = 0; + locs[TCCF_SLOT] = i; + locs[TCCF_OFFSET] = 0; /* * Attach the device. */ - config_found_sm_loc(self, "tc", ldesc, &ta, + config_found_sm_loc(self, "tc", locs, &ta, tcprint, tcsubmatch); } } @@ -208,18 +205,18 @@ tcprint(aux, pnp) } int -tcsubmatch(parent, cf, ldesc, aux) +tcsubmatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { if ((cf->cf_loc[TCCF_SLOT] != TCCF_SLOT_DEFAULT) && - (cf->cf_loc[TCCF_SLOT] != ldesc->locs[TCCF_SLOT])) + (cf->cf_loc[TCCF_SLOT] != locs[TCCF_SLOT])) return 0; if ((cf->cf_loc[TCCF_OFFSET] != TCCF_OFFSET_DEFAULT) && - (cf->cf_loc[TCCF_OFFSET] != ldesc->locs[TCCF_OFFSET])) + (cf->cf_loc[TCCF_OFFSET] != locs[TCCF_OFFSET])) return 0; return (config_match(parent, cf, aux)); diff --git a/sys/dev/tc/tcds.c b/sys/dev/tc/tcds.c index edb1dadd555..04caf2e434f 100644 --- a/sys/dev/tc/tcds.c +++ b/sys/dev/tc/tcds.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcds.c,v 1.14 2005/02/27 00:27:49 perry Exp $ */ +/* $NetBSD: tcds.c,v 1.15 2005/08/25 18:35:40 drochner Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.14 2005/02/27 00:27:49 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.15 2005/08/25 18:35:40 drochner Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -171,8 +171,7 @@ tcdsattach(parent, self, aux) bus_space_handle_t sbsh[2]; int i, gpi2; const struct evcnt *pevcnt; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[TCDSCF_NLOCS]; td = tcds_lookup(ta->ta_modname); if (td == NULL) @@ -308,10 +307,9 @@ tcdsattach(parent, self, aux) tcds_scsi_reset(tcdsdev.tcdsda_sc); - ldesc->len = 1; - ldesc->locs[TCDSCF_CHIP] = i; + locs[TCDSCF_CHIP] = i; - config_found_sm_loc(self, "tcds", ldesc, &tcdsdev, + config_found_sm_loc(self, "tcds", locs, &tcdsdev, tcdsprint, tcdssubmatch); #ifdef __alpha__ /* @@ -326,15 +324,15 @@ tcdsattach(parent, self, aux) } int -tcdssubmatch(parent, cf, ldesc, aux) +tcdssubmatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { if (cf->cf_loc[TCDSCF_CHIP] != TCDSCF_CHIP_DEFAULT && - cf->cf_loc[TCDSCF_CHIP] != ldesc->locs[TCDSCF_CHIP]) + cf->cf_loc[TCDSCF_CHIP] != locs[TCDSCF_CHIP]) return (0); return (config_match(parent, cf, aux)); diff --git a/sys/dev/tc/zs_ioasic.c b/sys/dev/tc/zs_ioasic.c index d2094902c4d..086cad8bac3 100644 --- a/sys/dev/tc/zs_ioasic.c +++ b/sys/dev/tc/zs_ioasic.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs_ioasic.c,v 1.26 2005/06/02 13:11:39 drochner Exp $ */ +/* $NetBSD: zs_ioasic.c,v 1.27 2005/08/25 18:35:40 drochner Exp $ */ /*- * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.26 2005/06/02 13:11:39 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.27 2005/08/25 18:35:40 drochner Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -249,8 +249,7 @@ zs_ioasic_attach(parent, self, aux) struct zshan *zc; int s, channel; u_long zflg; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[ZSCCF_NLOCS]; printf("\n"); @@ -319,14 +318,13 @@ zs_ioasic_attach(parent, self, aux) else cs->cs_ctl_chan = NULL; - ldesc->len = 1; - ldesc->locs[ZSCCF_CHANNEL] = channel; + locs[ZSCCF_CHANNEL] = channel; /* * Look for a child driver for this channel. * The child attach will setup the hardware. */ - if (config_found_sm_loc(self, "zsc", ldesc, (void *)&zs_args, + if (config_found_sm_loc(self, "zsc", locs, (void *)&zs_args, zs_ioasic_print, zs_ioasic_submatch) == NULL) { /* No sub-driver. Just reset it. */ u_char reset = (channel == 0) ? @@ -386,10 +384,10 @@ zs_ioasic_print(aux, name) } int -zs_ioasic_submatch(parent, cf, ldesc, aux) +zs_ioasic_submatch(parent, cf, locs, aux) struct device *parent; struct cfdata *cf; - const locdesc_t *ldesc; + const locdesc_t *locs; void *aux; { struct zsc_softc *zs = (void *)parent; @@ -397,7 +395,7 @@ zs_ioasic_submatch(parent, cf, ldesc, aux) const char *defname = ""; if (cf->cf_loc[ZSCCF_CHANNEL] != ZSCCF_CHANNEL_DEFAULT && - cf->cf_loc[ZSCCF_CHANNEL] != ldesc->locs[ZSCCF_CHANNEL]) + cf->cf_loc[ZSCCF_CHANNEL] != locs[ZSCCF_CHANNEL]) return (0); if (cf->cf_loc[ZSCCF_CHANNEL] == ZSCCF_CHANNEL_DEFAULT) { diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 8f276eb2d1e..2cf42b523b4 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhidev.c,v 1.27 2005/06/19 10:29:47 augustss Exp $ */ +/* $NetBSD: uhidev.c,v 1.28 2005/08/25 18:35:40 drochner Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.27 2005/06/19 10:29:47 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.28 2005/08/25 18:35:40 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -117,8 +117,7 @@ USB_ATTACH(uhidev) const void *descptr; usbd_status err; char *devinfop; - int help[2]; - locdesc_t *ldesc = (void *)help; /* XXX */ + int locs[UHIDBUSCF_NLOCS]; sc->sc_udev = uaa->device; sc->sc_iface = iface; @@ -286,11 +285,10 @@ USB_ATTACH(uhidev) ; /* already NULL in sc->sc_subdevs[repid] */ } else { uha.reportid = repid; - ldesc->len = 1; - ldesc->locs[UHIDBUSCF_REPORTID] = repid; + locs[UHIDBUSCF_REPORTID] = repid; dev = (struct uhidev *)config_found_sm_loc(self, - "uhidbus", ldesc, &uha, + "uhidbus", locs, &uha, uhidevprint, uhidevsubmatch); sc->sc_subdevs[repid] = dev; if (dev != NULL) { @@ -346,15 +344,15 @@ uhidevprint(void *aux, const char *pnp) int uhidevsubmatch(struct device *parent, struct cfdata *cf, - const locdesc_t *ldesc, void *aux) + const locdesc_t *locs, void *aux) { struct uhidev_attach_arg *uha = aux; if (cf->cf_loc[UHIDBUSCF_REPORTID] != UHIDBUSCF_REPORTID_DEFAULT && - cf->cf_loc[UHIDBUSCF_REPORTID] != ldesc->locs[UHIDBUSCF_REPORTID]) + cf->cf_loc[UHIDBUSCF_REPORTID] != locs[UHIDBUSCF_REPORTID]) return (0); - if (cf->cf_loc[UHIDBUSCF_REPORTID] == ldesc->locs[UHIDBUSCF_REPORTID]) + if (cf->cf_loc[UHIDBUSCF_REPORTID] == locs[UHIDBUSCF_REPORTID]) uha->matchlvl = UMATCH_VENDOR_PRODUCT; else uha->matchlvl = 0; |
