summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-06 23:12:18 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-06 23:12:18 +0000
commitfd70724e0c6df0ffd868e0c7d80b8f683072b49a (patch)
tree140851dd496663ab3addada146fd76ce4f7d40fe /sys
parent938a1718c74fd46e0af3080125cc5fa95e489e0c (diff)
Some archs used memset() rather than bzero(). So duplicate diff
previously applied to other archs deleting a memset() this time. e.g. - if ((mapstore = malloc(mapsize, M_DEVBUF, - (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) + if ((mapstore = malloc(mapsize, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ? + (M_NOWAIT | M_ZERO) : (M_WAITOK | M_ZERO))) == NULL) return (ENOMEM); - memset(mapstore, 0, mapsize);
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/isa/isadma_bounce.c7
-rw-r--r--sys/arch/arm/arm/bus_dma.c7
-rw-r--r--sys/arch/landisk/landisk/bus_dma.c7
-rw-r--r--sys/arch/mvme88k/mvme88k/bus_dma.c7
-rw-r--r--sys/arch/mvmeppc/mvmeppc/bus_dma.c7
5 files changed, 15 insertions, 20 deletions
diff --git a/sys/arch/alpha/isa/isadma_bounce.c b/sys/arch/alpha/isa/isadma_bounce.c
index 508583cfa6c..5bb4bea5ed6 100644
--- a/sys/arch/alpha/isa/isadma_bounce.c
+++ b/sys/arch/alpha/isa/isadma_bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isadma_bounce.c,v 1.6 2006/05/12 20:48:19 brad Exp $ */
+/* $OpenBSD: isadma_bounce.c,v 1.7 2007/10/06 23:12:17 krw Exp $ */
/* $NetBSD: isadma_bounce.c,v 1.3 2000/06/29 09:02:57 mrg Exp $ */
/*-
@@ -155,12 +155,11 @@ isadma_bounce_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments,
/*
* Allocate our cookie.
*/
- if ((cookiestore = malloc(cookiesize, M_DEVBUF,
- (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) {
+ if ((cookiestore = malloc(cookiesize, M_DEVBUF, (flags & BUS_DMA_NOWAIT)
+ ? (M_NOWAIT | M_ZERO) : (M_WAITOK | M_ZERO))) == NULL) {
error = ENOMEM;
goto out;
}
- memset(cookiestore, 0, cookiesize);
cookie = (struct isadma_bounce_cookie *)cookiestore;
cookie->id_flags = cookieflags;
map->_dm_cookie = cookie;
diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c
index c0247ded73d..f4c5ceb8551 100644
--- a/sys/arch/arm/arm/bus_dma.c
+++ b/sys/arch/arm/arm/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.10 2007/05/29 21:00:50 jason Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.11 2007/10/06 23:12:17 krw Exp $ */
/* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */
/*-
@@ -115,11 +115,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments,
*/
mapsize = sizeof(struct arm32_bus_dmamap) +
(sizeof(bus_dma_segment_t) * (nsegments - 1));
- if ((mapstore = malloc(mapsize, M_DEVBUF,
- (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+ if ((mapstore = malloc(mapsize, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ?
+ (M_NOWAIT | M_ZERO) : (M_WAITOK | M_ZERO))) == NULL)
return (ENOMEM);
- memset(mapstore, 0, mapsize);
map = (struct arm32_bus_dmamap *)mapstore;
map->_dm_size = size;
map->_dm_segcnt = nsegments;
diff --git a/sys/arch/landisk/landisk/bus_dma.c b/sys/arch/landisk/landisk/bus_dma.c
index 2269feac674..e3b1af937ee 100644
--- a/sys/arch/landisk/landisk/bus_dma.c
+++ b/sys/arch/landisk/landisk/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.3 2007/03/19 20:13:19 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.4 2007/10/06 23:12:17 krw Exp $ */
/* $NetBSD: bus_dma.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*
@@ -95,13 +95,12 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments,
error = 0;
mapsize = sizeof(struct _bus_dmamap) +
(sizeof(bus_dma_segment_t) * (nsegments - 1));
- if ((mapstore = malloc(mapsize, M_DEVBUF,
- (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+ if ((mapstore = malloc(mapsize, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ?
+ (M_NOWAIT | M_ZERO) : (M_WAITOK | M_ZERO))) == NULL)
return (ENOMEM);
DPRINTF(("bus_dmamap_create: dmamp = %p\n", mapstore));
- memset(mapstore, 0, mapsize);
map = (bus_dmamap_t)mapstore;
map->_dm_size = size;
map->_dm_segcnt = nsegments;
diff --git a/sys/arch/mvme88k/mvme88k/bus_dma.c b/sys/arch/mvme88k/mvme88k/bus_dma.c
index 01615fe0396..5b1070533b1 100644
--- a/sys/arch/mvme88k/mvme88k/bus_dma.c
+++ b/sys/arch/mvme88k/mvme88k/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.6 2007/09/03 01:09:09 krw Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.7 2007/10/06 23:12:17 krw Exp $ */
/* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */
/*-
@@ -95,11 +95,10 @@ bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
*/
mapsize = sizeof(struct m88k_bus_dmamap) +
(sizeof(bus_dma_segment_t) * (nsegments - 1));
- if ((mapstore = malloc(mapsize, M_DEVBUF,
- (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+ if ((mapstore = malloc(mapsize, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ?
+ (M_NOWAIT | M_ZERO) : (M_WAITOK | M_ZERO))) == NULL)
return (ENOMEM);
- memset(mapstore, 0, mapsize);
map = (struct m88k_bus_dmamap *)mapstore;
map->_dm_size = size;
map->_dm_segcnt = nsegments;
diff --git a/sys/arch/mvmeppc/mvmeppc/bus_dma.c b/sys/arch/mvmeppc/mvmeppc/bus_dma.c
index db2c84ca63f..3ce1ece72aa 100644
--- a/sys/arch/mvmeppc/mvmeppc/bus_dma.c
+++ b/sys/arch/mvmeppc/mvmeppc/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.19 2007/09/03 01:09:09 krw Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.20 2007/10/06 23:12:17 krw Exp $ */
/* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */
/*-
@@ -93,11 +93,10 @@ _bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
*/
mapsize = sizeof(struct powerpc_bus_dmamap) +
(sizeof(bus_dma_segment_t) * (nsegments - 1));
- if ((mapstore = malloc(mapsize, M_DEVBUF,
- (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+ if ((mapstore = malloc(mapsize, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ?
+ (M_NOWAIT | M_ZERO) : (M_WAITOK | M_ZERO))) == NULL)
return (ENOMEM);
- memset(mapstore, 0, mapsize);
map = (struct powerpc_bus_dmamap *)mapstore;
map->_dm_size = size;
map->_dm_segcnt = nsegments;