summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-09-17 01:33:34 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-09-17 01:33:34 +0000
commita854e6884a9635329a1490f5cf8420c8ab6f8f85 (patch)
tree29bd971e80c3ea6bf34f989e494141dcc2c006cb /sys/arch/sparc64
parent1dd97578d5974d04f8b171b17c36e35635acd61b (diff)
Only the most obvious bzero() -> M_ZERO changes. No cast changes, no
MALLOC/FREE, etc. Just adding M_ZERO to malloc() and deleting an immediately adjacent bzero().
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/central.c5
-rw-r--r--sys/arch/sparc64/dev/ebus_mainbus.c5
-rw-r--r--sys/arch/sparc64/dev/fhc.c5
-rw-r--r--sys/arch/sparc64/dev/sbus.c5
-rw-r--r--sys/arch/sparc64/dev/upa.c5
-rw-r--r--sys/arch/sparc64/sparc64/intr.c5
6 files changed, 12 insertions, 18 deletions
diff --git a/sys/arch/sparc64/dev/central.c b/sys/arch/sparc64/dev/central.c
index 896d578b010..dda9441a651 100644
--- a/sys/arch/sparc64/dev/central.c
+++ b/sys/arch/sparc64/dev/central.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: central.c,v 1.4 2004/09/27 17:28:03 jason Exp $ */
+/* $OpenBSD: central.c,v 1.5 2007/09/17 01:33:33 krw Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net)
@@ -150,11 +150,10 @@ central_alloc_bus_tag(struct central_softc *sc)
{
struct sparc_bus_space_tag *bt;
- bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT);
+ bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (bt == NULL)
panic("central: couldn't alloc bus tag");
- bzero(bt, sizeof(*bt));
snprintf(bt->name, sizeof(bt->name), "%s", sc->sc_dv.dv_xname);
bt->cookie = sc;
bt->parent = sc->sc_bt;
diff --git a/sys/arch/sparc64/dev/ebus_mainbus.c b/sys/arch/sparc64/dev/ebus_mainbus.c
index 2e1f0260474..5e14adb4a98 100644
--- a/sys/arch/sparc64/dev/ebus_mainbus.c
+++ b/sys/arch/sparc64/dev/ebus_mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ebus_mainbus.c,v 1.3 2007/04/07 20:15:54 kettenis Exp $ */
+/* $OpenBSD: ebus_mainbus.c,v 1.4 2007/09/17 01:33:33 krw Exp $ */
/*
* Copyright (c) 2007 Mark Kettenis
@@ -169,11 +169,10 @@ ebus_alloc_bus_tag(struct ebus_softc *sc, bus_space_tag_t parent)
{
struct sparc_bus_space_tag *bt;
- bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT);
+ bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (bt == NULL)
panic("could not allocate ebus bus tag");
- bzero(bt, sizeof *bt);
snprintf(bt->name, sizeof(bt->name), "%s", sc->sc_dev.dv_xname);
bt->cookie = sc;
bt->parent = parent;
diff --git a/sys/arch/sparc64/dev/fhc.c b/sys/arch/sparc64/dev/fhc.c
index 064d3990818..75c9822ccbb 100644
--- a/sys/arch/sparc64/dev/fhc.c
+++ b/sys/arch/sparc64/dev/fhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhc.c,v 1.13 2007/05/01 19:44:56 kettenis Exp $ */
+/* $OpenBSD: fhc.c,v 1.14 2007/09/17 01:33:33 krw Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net)
@@ -167,11 +167,10 @@ fhc_alloc_bus_tag(struct fhc_softc *sc)
{
struct sparc_bus_space_tag *bt;
- bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT);
+ bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (bt == NULL)
panic("fhc: couldn't alloc bus tag");
- bzero(bt, sizeof(*bt));
snprintf(bt->name, sizeof(bt->name), "%s", sc->sc_dv.dv_xname);
bt->cookie = sc;
bt->parent = sc->sc_bt;
diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c
index 8a77debba3b..242fa0be227 100644
--- a/sys/arch/sparc64/dev/sbus.c
+++ b/sys/arch/sparc64/dev/sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbus.c,v 1.27 2007/05/29 09:54:13 sobrado Exp $ */
+/* $OpenBSD: sbus.c,v 1.28 2007/09/17 01:33:33 krw Exp $ */
/* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */
/*-
@@ -772,11 +772,10 @@ sbus_alloc_bustag(struct sbus_softc *sc, int indirect)
{
struct sparc_bus_space_tag *sbt;
- sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT);
+ sbt = malloc(sizeof(*sbt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (sbt == NULL)
return (NULL);
- bzero(sbt, sizeof *sbt);
snprintf(sbt->name, sizeof(sbt->name), "%s",
sc->sc_dev.dv_xname);
sbt->cookie = sc;
diff --git a/sys/arch/sparc64/dev/upa.c b/sys/arch/sparc64/dev/upa.c
index 8b55ea4dfb4..323bdfaf68e 100644
--- a/sys/arch/sparc64/dev/upa.c
+++ b/sys/arch/sparc64/dev/upa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: upa.c,v 1.5 2007/03/05 18:58:30 kettenis Exp $ */
+/* $OpenBSD: upa.c,v 1.6 2007/09/17 01:33:33 krw Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -163,11 +163,10 @@ upa_alloc_bus_tag(struct upa_softc *sc)
{
struct sparc_bus_space_tag *bt;
- bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT);
+ bt = malloc(sizeof(*bt), M_DEVBUF, M_NOWAIT | M_ZERO);
if (bt == NULL)
panic("upa: couldn't alloc bus tag");
- bzero(bt, sizeof *bt);
snprintf(bt->name, sizeof(bt->name), "%s",
sc->sc_dev.dv_xname);
bt->cookie = sc;
diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c
index e9c424d1f2f..e488b25708e 100644
--- a/sys/arch/sparc64/sparc64/intr.c
+++ b/sys/arch/sparc64/sparc64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.27 2007/09/09 08:55:27 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.28 2007/09/17 01:33:33 krw Exp $ */
/* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */
/*
@@ -308,8 +308,7 @@ softintr_establish(level, fun, arg)
{
struct intrhand *ih;
- ih = malloc(sizeof(*ih), M_DEVBUF, 0);
- bzero(ih, sizeof(*ih));
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_ZERO);
ih->ih_fun = (int (*)(void *))fun; /* XXX */
ih->ih_arg = arg;
ih->ih_pil = level;