summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-08 18:30:14 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-08 18:30:14 +0000
commit2a12caa92ac207761aa182f06eba4899f0f4abbb (patch)
tree72817db819a579503d308b25ff51fc0edde6c4e9 /sys
parent483392ba73a7eaba1e4f85e4d5df4a3b1587df8f (diff)
A few trailing bzero/memset -> M_ZERO occurrences, cast removal and
size(*p) usage. This should be the last of the simple malloc() changes.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/psycho.c6
-rw-r--r--sys/arch/sparc64/dev/pyro.c5
-rw-r--r--sys/arch/sparc64/dev/schizo.c5
3 files changed, 6 insertions, 10 deletions
diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c
index 4034f56f428..2fae1859431 100644
--- a/sys/arch/sparc64/dev/psycho.c
+++ b/sys/arch/sparc64/dev/psycho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psycho.c,v 1.53 2007/09/08 10:50:04 martin Exp $ */
+/* $OpenBSD: psycho.c,v 1.54 2007/10/08 18:30:13 krw Exp $ */
/* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */
/*
@@ -614,11 +614,9 @@ psycho_set_intr(struct psycho_softc *sc, int ipl, void *handler,
{
struct intrhand *ih;
- ih = (struct intrhand *)malloc(sizeof(struct intrhand),
- M_DEVBUF, M_NOWAIT);
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT | M_ZERO);
if (ih == NULL)
panic("couldn't malloc intrhand");
- memset(ih, 0, sizeof(struct intrhand));
ih->ih_arg = sc;
ih->ih_map = mapper;
ih->ih_clr = clearer;
diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c
index d69f9604c9d..79ac9830a6b 100644
--- a/sys/arch/sparc64/dev/pyro.c
+++ b/sys/arch/sparc64/dev/pyro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pyro.c,v 1.8 2007/09/18 00:46:41 krw Exp $ */
+/* $OpenBSD: pyro.c,v 1.9 2007/10/08 18:30:13 krw Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -141,10 +141,9 @@ pyro_init(struct pyro_softc *sc, int busa)
struct pcibus_attach_args pba;
int *busranges = NULL, nranges;
- pbm = (struct pyro_pbm *)malloc(sizeof(*pbm), M_DEVBUF, M_NOWAIT);
+ pbm = malloc(sizeof(*pbm), M_DEVBUF, M_NOWAIT | M_ZERO);
if (pbm == NULL)
panic("pyro: can't alloc pyro pbm");
- bzero(pbm, sizeof(*pbm));
pbm->pp_sc = sc;
pbm->pp_bus_a = busa;
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c
index 998121d2d92..c82d30de440 100644
--- a/sys/arch/sparc64/dev/schizo.c
+++ b/sys/arch/sparc64/dev/schizo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schizo.c,v 1.49 2007/09/18 00:46:41 krw Exp $ */
+/* $OpenBSD: schizo.c,v 1.50 2007/10/08 18:30:13 krw Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -163,10 +163,9 @@ schizo_init(struct schizo_softc *sc, int busa)
int *busranges = NULL, nranges;
u_int64_t match, reg;
- pbm = (struct schizo_pbm *)malloc(sizeof(*pbm), M_DEVBUF, M_NOWAIT);
+ pbm = malloc(sizeof(*pbm), M_DEVBUF, M_NOWAIT | M_ZERO);
if (pbm == NULL)
panic("schizo: can't alloc schizo pbm");
- bzero(pbm, sizeof(*pbm));
pbm->sp_sc = sc;
pbm->sp_bus_a = busa;