diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-02 00:59:13 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-02 00:59:13 +0000 |
commit | fcfb7cb8255b0a7271e581314b67d6479d83ad7c (patch) | |
tree | e9efdb5a76104b7303a0b6dddab7ae12a4d352ed /sys/arch/vax | |
parent | a6b481e93e8e14c27731c12457de6fdb40c61dd6 (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/vax')
-rw-r--r-- | sys/arch/vax/vax/bus_dma.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c index 0c117f9f0c3..b1ce6da8311 100644 --- a/sys/arch/vax/vax/bus_dma.c +++ b/sys/arch/vax/vax/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.17 2007/09/03 01:09:09 krw Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.18 2007/10/02 00:59:12 krw Exp $ */ /* $NetBSD: bus_dma.c,v 1.5 1999/11/13 00:32:20 thorpej Exp $ */ /*- @@ -107,11 +107,10 @@ _bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp) */ mapsize = sizeof(struct vax_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 vax_bus_dmamap *)mapstore; map->_dm_size = size; map->_dm_segcnt = nsegments; |