summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r--sys/dev/sbus/dma_sbus.c5
-rw-r--r--sys/dev/sbus/isp_sbus.c6
-rw-r--r--sys/dev/sbus/lebuffer.c5
-rw-r--r--sys/dev/sbus/qec.c5
4 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/sbus/dma_sbus.c b/sys/dev/sbus/dma_sbus.c
index e4b94a5cc05..48cb2bddac1 100644
--- a/sys/dev/sbus/dma_sbus.c
+++ b/sys/dev/sbus/dma_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma_sbus.c,v 1.13 2006/06/02 20:00:56 miod Exp $ */
+/* $OpenBSD: dma_sbus.c,v 1.14 2007/09/10 19:49:31 gilles Exp $ */
/* $NetBSD: dma_sbus.c,v 1.5 2000/07/09 20:57:42 pk Exp $ */
/*-
@@ -279,11 +279,10 @@ dma_alloc_bustag(struct dma_softc *sc)
{
struct sparc_bus_space_tag *sbt;
- sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT);
+ sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT|M_ZERO);
if (sbt == NULL)
return (NULL);
- bzero(sbt, sizeof *sbt);
sbt->cookie = sc;
sbt->parent = sc->sc_lsi64854.sc_bustag;
sbt->asi = sbt->parent->asi;
diff --git a/sys/dev/sbus/isp_sbus.c b/sys/dev/sbus/isp_sbus.c
index 35b9403240b..ea8aa78cfda 100644
--- a/sys/dev/sbus/isp_sbus.c
+++ b/sys/dev/sbus/isp_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_sbus.c,v 1.8 2006/06/02 20:00:56 miod Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.9 2007/09/10 19:49:31 gilles Exp $ */
/* $NetBSD: isp_sbus.c,v 1.46 2001/09/26 20:53:14 eeh Exp $ */
/*
@@ -380,12 +380,12 @@ isp_sbus_mbxdma(struct ispsoftc *isp)
return (0);
n = isp->isp_maxcmds * sizeof (XS_T *);
- isp->isp_xflist = (XS_T **) malloc(n, M_DEVBUF, M_WAITOK);
+ isp->isp_xflist = (XS_T **) malloc(n, M_DEVBUF, M_WAITOK|M_ZERO);
if (isp->isp_xflist == NULL) {
isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array");
return (1);
}
- MEMZERO(isp->isp_xflist, n);
+
n = sizeof (bus_dmamap_t) * isp->isp_maxcmds;
sbc->sbus_dmamap = (bus_dmamap_t *) malloc(n, M_DEVBUF, M_WAITOK);
if (sbc->sbus_dmamap == NULL) {
diff --git a/sys/dev/sbus/lebuffer.c b/sys/dev/sbus/lebuffer.c
index 4e9397295fd..1cc9f1cf2db 100644
--- a/sys/dev/sbus/lebuffer.c
+++ b/sys/dev/sbus/lebuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lebuffer.c,v 1.6 2006/06/02 20:00:56 miod Exp $ */
+/* $OpenBSD: lebuffer.c,v 1.7 2007/09/10 19:49:31 gilles Exp $ */
/* $NetBSD: lebuffer.c,v 1.12 2002/03/11 16:00:57 pk Exp $ */
/*-
@@ -131,12 +131,11 @@ lebufattach(struct device *parent, struct device *self, void *aux)
sc->sc_burst &= sbusburst;
/* Allocate a bus tag */
- sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT);
+ sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT|M_ZERO);
if (sbt == NULL) {
printf("%s: attach: out of memory\n", self->dv_xname);
return;
}
- bzero(sbt, sizeof(*sbt));
printf(": %dK memory\n", sc->sc_bufsiz / 1024);
diff --git a/sys/dev/sbus/qec.c b/sys/dev/sbus/qec.c
index 5f118c0b5a3..bc699718374 100644
--- a/sys/dev/sbus/qec.c
+++ b/sys/dev/sbus/qec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qec.c,v 1.10 2006/06/02 20:00:56 miod Exp $ */
+/* $OpenBSD: qec.c,v 1.11 2007/09/10 19:49:31 gilles Exp $ */
/* $NetBSD: qec.c,v 1.12 2000/12/04 20:12:55 fvdl Exp $ */
/*-
@@ -192,13 +192,12 @@ qecattach(parent, self, aux)
}
/* Allocate a bus tag */
- sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT);
+ sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT|M_ZERO);
if (sbt == NULL) {
printf("%s: attach: out of memory\n", self->dv_xname);
return;
}
- bzero(sbt, sizeof *sbt);
strlcpy(sbt->name, sc->sc_dev.dv_xname, sizeof(sbt->name));
sbt->cookie = sc;
sbt->parent = sc->sc_bustag;