summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-01 16:11:20 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-01 16:11:20 +0000
commit1d3a2c7615ad6b5663e200fe3e8a475ef3203245 (patch)
treede1c38fdba408d50ca09e62ce6c6e40d21d28491 /sys/arch/sparc64/dev
parenta730dedabc875f93e81898068b1cccdb9e45cb7c (diff)
More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...' where
obvious.
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r--sys/arch/sparc64/dev/ebus.c6
-rw-r--r--sys/arch/sparc64/dev/fd.c5
-rw-r--r--sys/arch/sparc64/dev/pckbc_ebus.c5
3 files changed, 6 insertions, 10 deletions
diff --git a/sys/arch/sparc64/dev/ebus.c b/sys/arch/sparc64/dev/ebus.c
index 8ffae5cb851..3fb1068e57e 100644
--- a/sys/arch/sparc64/dev/ebus.c
+++ b/sys/arch/sparc64/dev/ebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ebus.c,v 1.18 2007/09/18 00:46:41 krw Exp $ */
+/* $OpenBSD: ebus.c,v 1.19 2007/10/01 16:11:19 krw Exp $ */
/* $NetBSD: ebus.c,v 1.24 2001/07/25 03:49:54 eeh Exp $ */
/*
@@ -395,12 +395,10 @@ ebus_alloc_dma_tag(struct ebus_softc *sc, bus_dma_tag_t pdt)
{
bus_dma_tag_t dt;
- 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("could not allocate ebus dma tag");
- bzero(dt, sizeof *dt);
dt->_cookie = sc;
dt->_parent = pdt;
sc->sc_dmatag = dt;
diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c
index c8a3d71faa9..fc23660c18d 100644
--- a/sys/arch/sparc64/dev/fd.c
+++ b/sys/arch/sparc64/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.18 2007/06/20 18:15:46 deraadt Exp $ */
+/* $OpenBSD: fd.c,v 1.19 2007/10/01 16:11:19 krw Exp $ */
/* $NetBSD: fd.c,v 1.112 2003/08/07 16:29:35 agc Exp $ */
/*-
@@ -1943,11 +1943,10 @@ fdformat(dev, finfo, p)
struct buf *bp;
/* set up a buffer header for fdstrategy() */
- bp = (struct buf *)malloc(sizeof(struct buf), M_TEMP, M_NOWAIT);
+ bp = malloc(sizeof(*bp), M_TEMP, M_NOWAIT | M_ZERO);
if (bp == NULL)
return (ENOBUFS);
- bzero((void *)bp, sizeof(struct buf));
bp->b_flags = B_BUSY | B_PHYS | B_FORMAT;
bp->b_proc = p;
bp->b_dev = dev;
diff --git a/sys/arch/sparc64/dev/pckbc_ebus.c b/sys/arch/sparc64/dev/pckbc_ebus.c
index 82e9a942213..f2e432987bd 100644
--- a/sys/arch/sparc64/dev/pckbc_ebus.c
+++ b/sys/arch/sparc64/dev/pckbc_ebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbc_ebus.c,v 1.7 2004/11/02 21:17:39 miod Exp $ */
+/* $OpenBSD: pckbc_ebus.c,v 1.8 2007/10/01 16:11:19 krw Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -141,8 +141,7 @@ pckbc_ebus_attach(parent, self, aux)
return;
}
- t = malloc(sizeof(struct pckbc_internal), M_DEVBUF, M_NOWAIT);
- bzero(t, sizeof(struct pckbc_internal));
+ t = malloc(sizeof(*t), M_DEVBUF, M_NOWAIT | M_ZERO);
}
psc->intr_establish = pckbc_ebus_intr_establish;