diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-05-18 20:54:35 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-05-18 20:54:35 +0000 |
commit | 471c4c53f78d1b1bd743b3d9c49e6651c62fa391 (patch) | |
tree | 64baa7539e9bde9386115647203e74f6404a1206 | |
parent | 9165a33c6c16d1c44cb892561f815357e3c5eff8 (diff) |
bus_dmamem_alloc() ...; bzero/memset(); ->
bus_dmamem_alloc(, BUS_DMA_ZERO);
"ok on all the ones with my copyright" marco@
-rw-r--r-- | sys/dev/ic/ami.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/qli_pci.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 4113ba72f51..a99285b9906 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.202 2010/05/16 20:33:59 nicm Exp $ */ +/* $OpenBSD: ami.c,v 1.203 2010/05/18 20:54:34 oga Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -272,7 +272,7 @@ ami_allocmem(struct ami_softc *sc, size_t size) goto amfree; if (bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &am->am_seg, 1, - &nsegs, BUS_DMA_NOWAIT) != 0) + &nsegs, BUS_DMA_NOWAIT | BUS_DMA_ZERO) != 0) goto destroy; if (bus_dmamem_map(sc->sc_dmat, &am->am_seg, nsegs, size, &am->am_kva, @@ -283,7 +283,6 @@ ami_allocmem(struct ami_softc *sc, size_t size) BUS_DMA_NOWAIT) != 0) goto unmap; - memset(am->am_kva, 0, size); return (am); unmap: diff --git a/sys/dev/pci/qli_pci.c b/sys/dev/pci/qli_pci.c index 8f2baf4de6c..611c3959e13 100644 --- a/sys/dev/pci/qli_pci.c +++ b/sys/dev/pci/qli_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qli_pci.c,v 1.16 2010/03/23 01:57:20 krw Exp $ */ +/* $OpenBSD: qli_pci.c,v 1.17 2010/05/18 20:54:34 oga Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2007 David Collins <dave@davec.name> @@ -313,7 +313,7 @@ qli_allocmem(struct qli_softc *sc, size_t size) goto amfree; if (bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &mm->am_seg, 1, - &nsegs, BUS_DMA_NOWAIT) != 0) + &nsegs, BUS_DMA_NOWAIT | BUS_DMA_ZERO) != 0) goto destroy; if (bus_dmamem_map(sc->sc_dmat, &mm->am_seg, nsegs, size, &mm->am_kva, @@ -327,7 +327,6 @@ qli_allocmem(struct qli_softc *sc, size_t size) DNPRINTF(QLI_D_MEM, " kva: %p dva: %p map: %p\n", mm->am_kva, mm->am_map->dm_segs[0].ds_addr, mm->am_map); - memset(mm->am_kva, 0, size); return (mm); unmap: |