summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-11-11 17:47:01 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-11-11 17:47:01 +0000
commitb37d7f96fb3abe514655717c4b8cf821c6eae0ca (patch)
treec132501d52744056a4897d2e74495f1919d5cd8a /sys/arch
parente36211dd21709c1c1efda83c64a6cf275a82a673 (diff)
Pass a few more M_ZERO to malloc() or its wrappers, when useful; ok krw@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/fga.c5
-rw-r--r--sys/arch/sparc/dev/isp_sbus.c9
-rw-r--r--sys/arch/sparc/dev/qe.c8
-rw-r--r--sys/arch/sparc/dev/xd.c5
4 files changed, 11 insertions, 16 deletions
diff --git a/sys/arch/sparc/dev/fga.c b/sys/arch/sparc/dev/fga.c
index 25247aace7e..102a995725a 100644
--- a/sys/arch/sparc/dev/fga.c
+++ b/sys/arch/sparc/dev/fga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fga.c,v 1.16 2010/09/20 06:33:47 matthew Exp $ */
+/* $OpenBSD: fga.c,v 1.17 2010/11/11 17:46:58 miod Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -520,10 +520,9 @@ fga_intr_establish(sc, vec, level, ih, name)
/* setup vector handler */
if (sc->sc_vmevec == NULL) {
sc->sc_vmevec = (struct intrhand **)malloc(256 *
- sizeof(struct intrhand *), M_DEVBUF, M_NOWAIT);
+ sizeof(struct intrhand *), M_DEVBUF, M_NOWAIT | M_ZERO);
if (sc->sc_vmevec == NULL)
panic("fga_addirq");
- bzero(sc->sc_vmevec, 256 * sizeof(struct intrhand *));
}
if (sc->sc_vmevec[vec] == NULL)
sc->sc_vmevec[vec] = ih;
diff --git a/sys/arch/sparc/dev/isp_sbus.c b/sys/arch/sparc/dev/isp_sbus.c
index bd5b062d6b2..93ad2838e43 100644
--- a/sys/arch/sparc/dev/isp_sbus.c
+++ b/sys/arch/sparc/dev/isp_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_sbus.c,v 1.29 2009/08/30 21:22:25 kettenis Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.30 2010/11/11 17:46:58 miod Exp $ */
/*
* SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
*
@@ -443,11 +443,10 @@ isp_sbus_mbxdma(struct ispsoftc *isp)
*/
len = isp->isp_maxcmds * sizeof (XS_T);
- isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK);
- bzero(isp->isp_xflist, len);
+ isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
len = isp->isp_maxcmds * sizeof (vaddr_t);
- sbc->sbus_kdma_allocs = (vaddr_t *) malloc(len, M_DEVBUF, M_WAITOK);
- bzero(sbc->sbus_kdma_allocs, len);
+ sbc->sbus_kdma_allocs = (vaddr_t *) malloc(len, M_DEVBUF,
+ M_WAITOK | M_ZERO);
/*
* Allocate and map the request queue.
diff --git a/sys/arch/sparc/dev/qe.c b/sys/arch/sparc/dev/qe.c
index 44f5bfa8d3b..6df7333ea5f 100644
--- a/sys/arch/sparc/dev/qe.c
+++ b/sys/arch/sparc/dev/qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qe.c,v 1.32 2008/11/28 02:44:17 brad Exp $ */
+/* $OpenBSD: qe.c,v 1.33 2010/11/11 17:46:58 miod Exp $ */
/*
* Copyright (c) 1998, 2000 Jason L. Wright.
@@ -671,13 +671,11 @@ qeinit(sc)
*/
if (sc->sc_desc == NULL)
sc->sc_desc_dva = (struct qe_desc *) dvma_malloc(
- sizeof(struct qe_desc), &sc->sc_desc, M_NOWAIT);
- bzero(sc->sc_desc, sizeof(struct qe_desc));
+ sizeof(struct qe_desc), &sc->sc_desc, M_NOWAIT | M_ZERO);
if (sc->sc_bufs == NULL)
sc->sc_bufs_dva = (struct qe_bufs *) dvma_malloc(
- sizeof(struct qe_bufs), &sc->sc_bufs, M_NOWAIT);
- bzero(sc->sc_bufs, sizeof(struct qe_bufs));
+ sizeof(struct qe_bufs), &sc->sc_bufs, M_NOWAIT | M_ZERO);
for (i = 0; i < QE_TX_RING_MAXSIZE; i++)
sc->sc_desc->qe_txd[i].tx_addr =
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index c61b96affc5..c284d4e8390 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.52 2010/09/22 06:40:25 krw Exp $ */
+/* $OpenBSD: xd.c,v 1.53 2010/11/11 17:46:58 miod Exp $ */
/* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */
/*
@@ -413,9 +413,8 @@ xdcattach(parent, self, aux)
xdc->dvmaiopb = (struct xd_iopb *)
dvma_malloc(XDC_MAXIOPB * sizeof(struct xd_iopb), &xdc->iopbase,
- M_NOWAIT);
+ M_NOWAIT | M_ZERO);
xdc->iopbase = xdc->dvmaiopb; /* XXX TMP HACK */
- bzero(xdc->iopbase, XDC_MAXIOPB * sizeof(struct xd_iopb));
/* Setup device view of DVMA address */
xdc->dvmaiopb = (struct xd_iopb *) ((u_long) xdc->iopbase - DVMA_BASE);