summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-02 00:59:13 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-02 00:59:13 +0000
commitfcfb7cb8255b0a7271e581314b67d6479d83ad7c (patch)
treee9efdb5a76104b7303a0b6dddab7ae12a4d352ed /sys/arch/sgi
parenta6b481e93e8e14c27731c12457de6fdb40c61dd6 (diff)
Apply (with slight variants) this elimination of bzero() with M_ZERO:
- 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); - bzero(mapstore, mapsize);
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r--sys/arch/sgi/sgi/bus_dma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c
index 243713314d5..b380a14aa1d 100644
--- a/sys/arch/sgi/sgi/bus_dma.c
+++ b/sys/arch/sgi/sgi/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.2 2007/07/18 20:03:51 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.3 2007/10/02 00:59:12 krw Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -73,11 +73,10 @@ _dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
*/
mapsize = sizeof(struct machine_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);
- bzero(mapstore, mapsize);
map = (struct machine_bus_dmamap *)mapstore;
map->_dm_size = size;
map->_dm_segcnt = nsegments;