summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-10 11:31:50 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-10 11:31:50 +0000
commiteae51991a541a6e1a2e0974aaeb7df533204e03a (patch)
treee00ab9b51ccb808bfdf2dc6e4727c3ac2c7c0e88 /sys/arch/sparc64
parentd58e96b237e722b2df95155b0a86461ce738354b (diff)
malloc+bzero -> malloc+M_ZERO. Use 'malloc(sizeof(*p) ...' idiom.
This completes my bzero/memset(,0,) -> M_ZERO sweep of the tree. ok kettenis@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/pyro.c6
-rw-r--r--sys/arch/sparc64/dev/schizo.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c
index 79ac9830a6b..ab2ba3e577d 100644
--- a/sys/arch/sparc64/dev/pyro.c
+++ b/sys/arch/sparc64/dev/pyro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pyro.c,v 1.9 2007/10/08 18:30:13 krw Exp $ */
+/* $OpenBSD: pyro.c,v 1.10 2007/10/10 11:31:49 krw Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -322,12 +322,10 @@ pyro_alloc_dma_tag(struct pyro_pbm *pbm)
struct pyro_softc *sc = pbm->pp_sc;
bus_dma_tag_t dt, pdt = sc->sc_dmat;
- dt = (bus_dma_tag_t)malloc(sizeof(struct sparc_bus_dma_tag),
- M_DEVBUF, M_NOWAIT);
+ dt = malloc(sizeof(*dt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (dt == NULL)
panic("pyro: could not alloc dma tag");
- bzero(dt, sizeof(*dt));
dt->_cookie = pbm;
dt->_parent = pdt;
dt->_dmamap_create = pyro_dmamap_create;
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c
index c82d30de440..7ef71e793c9 100644
--- a/sys/arch/sparc64/dev/schizo.c
+++ b/sys/arch/sparc64/dev/schizo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schizo.c,v 1.50 2007/10/08 18:30:13 krw Exp $ */
+/* $OpenBSD: schizo.c,v 1.51 2007/10/10 11:31:49 krw Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -556,12 +556,10 @@ schizo_alloc_dma_tag(struct schizo_pbm *pbm)
struct schizo_softc *sc = pbm->sp_sc;
bus_dma_tag_t dt, pdt = sc->sc_dmat;
- dt = (bus_dma_tag_t)malloc(sizeof(struct sparc_bus_dma_tag),
- M_DEVBUF, M_NOWAIT);
+ dt = malloc(sizeof(*dt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (dt == NULL)
panic("schizo: could not alloc dma tag");
- bzero(dt, sizeof(*dt));
dt->_cookie = pbm;
dt->_parent = pdt;
dt->_dmamap_create = schizo_dmamap_create;