diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-08 17:48:07 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-08 17:48:07 +0000 |
commit | fc2353b74733ab682dfac772af7f48100285828e (patch) | |
tree | b8de9934919b3897a2968c996ece15b14aa7824d /sys/arch | |
parent | d8fb009b456a8195efa5e4a53a0c2b7ce816b7f6 (diff) |
A few trailing bzero/memset -> M_ZERO occurrences, cast removal and
size(*p) usage.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/dev/obio.c | 16 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/sbus.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/vax/mscp/mscp.c | 6 |
4 files changed, 12 insertions, 22 deletions
diff --git a/sys/arch/sparc/dev/obio.c b/sys/arch/sparc/dev/obio.c index 6e1234d8dfc..7be6f191120 100644 --- a/sys/arch/sparc/dev/obio.c +++ b/sys/arch/sparc/dev/obio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: obio.c,v 1.18 2007/07/01 19:07:45 miod Exp $ */ +/* $OpenBSD: obio.c,v 1.19 2007/10/08 17:48:06 krw Exp $ */ /* $NetBSD: obio.c,v 1.37 1997/07/29 09:58:11 fair Exp $ */ /* @@ -297,11 +297,10 @@ vmesattach(parent, self, args) printf("\n"); if (vmeints == NULL) { - vmeints = (struct intrhand **)malloc(256 * - sizeof(struct intrhand *), M_TEMP, M_NOWAIT); + vmeints = malloc(256 * sizeof(struct intrhand *), M_TEMP, + M_NOWAIT | M_ZERO); if (vmeints == NULL) panic("vmesattach: can't allocate intrhand"); - bzero(vmeints, 256 * sizeof(struct intrhand *)); } (void)config_search(vmes_scan, self, args); bus_untmp(); @@ -320,11 +319,10 @@ vmelattach(parent, self, args) printf("\n"); if (vmeints == NULL) { - vmeints = (struct intrhand **)malloc(256 * - sizeof(struct intrhand *), M_TEMP, M_NOWAIT); + vmeints = malloc(256 * sizeof(struct intrhand *), M_TEMP, + M_NOWAIT | M_ZERO); if (vmeints == NULL) panic("vmelattach: can't allocate intrhand"); - bzero(vmeints, 256 * sizeof(struct intrhand *)); } (void)config_search(vmel_scan, self, args); bus_untmp(); @@ -628,11 +626,9 @@ vmeintr_establish(vec, level, ih, ipl_block, name) if (ihs->ih_fun == vmeintr) return; - ihs = (struct intrhand *)malloc(sizeof(struct intrhand), - M_TEMP, M_NOWAIT); + ihs = malloc(sizeof(*ihs), M_TEMP, M_NOWAIT | M_ZERO); if (ihs == NULL) panic("vme_addirq"); - bzero(ihs, sizeof *ihs); ihs->ih_fun = vmeintr; ihs->ih_arg = (void *)level; intr_establish(level, ihs, ipl_block, NULL); diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c index 242fa0be227..4477553d62b 100644 --- a/sys/arch/sparc64/dev/sbus.c +++ b/sys/arch/sparc64/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.28 2007/09/17 01:33:33 krw Exp $ */ +/* $OpenBSD: sbus.c,v 1.29 2007/10/08 17:48:06 krw Exp $ */ /* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */ /*- @@ -356,11 +356,9 @@ sbus_mb_attach(struct device *parent, struct device *self, void *aux) iommu_init(name, &sc->sc_is, 0, -1); /* Enable the over temp intr */ - 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_map = &sysio->therm_int_map; ih->ih_clr = NULL; /* &sysio->therm_clr_int; */ ih->ih_fun = sbus_overtemp; diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 5613eeb8e32..8885cc1ad7b 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.97 2007/10/02 00:59:12 krw Exp $ */ +/* $OpenBSD: machdep.c,v 1.98 2007/10/08 17:48:06 krw Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -1809,12 +1809,10 @@ bus_intr_allocate(bus_space_tag_t t, int (*handler)(void *), void *arg, { 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) return (NULL); - memset(ih, 0, sizeof(struct intrhand)); - ih->ih_fun = handler; ih->ih_arg = arg; ih->ih_number = number; diff --git a/sys/arch/vax/mscp/mscp.c b/sys/arch/vax/mscp/mscp.c index 0a62fcded95..d4034fdde5a 100644 --- a/sys/arch/vax/mscp/mscp.c +++ b/sys/arch/vax/mscp/mscp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mscp.c,v 1.9 2005/11/24 04:53:56 brad Exp $ */ +/* $OpenBSD: mscp.c,v 1.10 2007/10/08 17:48:06 krw Exp $ */ /* $NetBSD: mscp.c,v 1.16 2001/11/13 07:38:28 lukem Exp $ */ /* @@ -180,11 +180,9 @@ loop: */ if (mp->mscp_unit >= mi->mi_driveno) { /* Must expand drive table */ int tmpno = ((mp->mscp_unit + 32) & 0xffe0) * sizeof(void *); - struct device **tmp = (struct device **) - malloc(tmpno, M_DEVBUF, M_NOWAIT); + struct device **tmp = malloc(tmpno, M_DEVBUF, M_NOWAIT|M_ZERO); if (tmp == NULL) panic("mscp_dorsp"); - bzero(tmp, tmpno); if (mi->mi_driveno) { bcopy(mi->mi_dp, tmp, mi->mi_driveno); free(mi->mi_dp, mi->mi_driveno); |