summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-09-16 01:04:19 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-09-16 01:04:19 +0000
commit02615ca7e3f0875866ab3926f12fdcb300b2e958 (patch)
tree00777f1053fb33c604a4ee15d3dc928289c82f89 /sys/dev
parent9cc048eb49ae7f53cad96585ad66a60137b5738e (diff)
Obvious M_ZERO changes.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/i2o/iop.c11
-rw-r--r--sys/dev/i2o/iopsp.c8
2 files changed, 7 insertions, 12 deletions
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c
index 3fb786f8c72..2fb256093ef 100644
--- a/sys/dev/i2o/iop.c
+++ b/sys/dev/i2o/iop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iop.c,v 1.29 2006/11/29 12:24:17 miod Exp $ */
+/* $OpenBSD: iop.c,v 1.30 2007/09/16 01:04:18 krw Exp $ */
/* $NetBSD: iop.c,v 1.12 2001/03/21 14:27:05 ad Exp $ */
/*-
@@ -353,14 +353,13 @@ iop_init(struct iop_softc *sc, const char *intrstr)
sc->sc_maxib = IOP_MAX_INBOUND;
/* Allocate message wrappers. */
- im = malloc(sizeof(*im) * sc->sc_maxib, M_DEVBUF, M_NOWAIT);
+ im = malloc(sizeof(*im) * sc->sc_maxib, M_DEVBUF, M_NOWAIT | M_ZERO);
if (!im) {
printf("%s: couldn't allocate message", sc->sc_dv.dv_xname);
goto bail_out;
}
state++;
- bzero(im, sizeof(*im) * sc->sc_maxib);
sc->sc_ims = im;
SLIST_INIT(&sc->sc_im_freelist);
@@ -467,11 +466,10 @@ iop_config_interrupts(struct device *self)
i = sizeof(struct i2o_systab_entry) * (niop - 1) +
sizeof(struct i2o_systab);
iop_systab_size = i;
- iop_systab = malloc(i, M_DEVBUF, M_NOWAIT);
+ iop_systab = malloc(i, M_DEVBUF, M_NOWAIT | M_ZERO);
if (!iop_systab)
return;
- bzero(iop_systab, i);
iop_systab->numentries = niop;
iop_systab->version = I2O_VERSION_11;
@@ -682,12 +680,11 @@ iop_reconfigure(struct iop_softc *sc, u_int chgind)
if (sc->sc_tidmap != NULL)
free(sc->sc_tidmap, M_DEVBUF);
sc->sc_tidmap = malloc(sc->sc_nlctent * sizeof(struct iop_tidmap),
- M_DEVBUF, M_NOWAIT);
+ M_DEVBUF, M_NOWAIT | M_ZERO);
if (!sc->sc_tidmap) {
DPRINTF(("iop_reconfigure: out of memory\n"));
return (ENOMEM);
}
- bzero(sc->sc_tidmap, sc->sc_nlctent * sizeof(struct iop_tidmap));
/* Allow 1 queued command per device while we're configuring. */
iop_adjqparam(sc, 1);
diff --git a/sys/dev/i2o/iopsp.c b/sys/dev/i2o/iopsp.c
index 4604bd2a94b..b9a12fe5979 100644
--- a/sys/dev/i2o/iopsp.c
+++ b/sys/dev/i2o/iopsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iopsp.c,v 1.9 2006/11/28 23:59:45 dlg Exp $ */
+/* $OpenBSD: iopsp.c,v 1.10 2007/09/16 01:04:18 krw Exp $ */
/* $NetBSD$ */
/*-
@@ -208,8 +208,7 @@ iopsp_attach(struct device *parent, struct device *self, void *aux)
* purposes only.
*/
size = sc->sc_link.adapter_buswidth * sizeof(struct iopsp_target);
- sc->sc_targetmap = malloc(size, M_DEVBUF, M_NOWAIT);
- bzero(sc->sc_targetmap, size);
+ sc->sc_targetmap = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO);
#endif
/* Build the two maps, and attach to scsi. */
@@ -260,9 +259,8 @@ iopsp_reconfig(struct device *dv)
* and we never address that here).
*/
size = sc->sc_link.adapter_buswidth * IOPSP_MAX_LUN * sizeof(u_short);
- if (!(tidmap = malloc(size, M_DEVBUF, M_NOWAIT)))
+ if (!(tidmap = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO)))
return (ENOMEM);
- bzero(tidmap, size);
#ifdef I2OVERBOSE
for (i = 0; i < sc->sc_link.adapter_buswidth; i++)