diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-06 23:50:56 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-06 23:50:56 +0000 |
commit | f5461d41b129fefc48ff4c9ded82554394de9bf0 (patch) | |
tree | 86f9d97cdbd7712121debe572c568e72070e2559 /sys/arch/hppa/dev | |
parent | fd70724e0c6df0ffd868e0c7d80b8f683072b49a (diff) |
Simpliest memset(,0,) -> M_ZERO changes. One (caddr *) cast removal,
otherwise just adding M_ZERO to malloc() and removing the immediately
adjacent memset(,0,).
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r-- | sys/arch/hppa/dev/apic.c | 6 | ||||
-rw-r--r-- | sys/arch/hppa/dev/astro.c | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sys/arch/hppa/dev/apic.c b/sys/arch/hppa/dev/apic.c index 631ac9cf259..7e8bc7f684d 100644 --- a/sys/arch/hppa/dev/apic.c +++ b/sys/arch/hppa/dev/apic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apic.c,v 1.6 2007/07/01 14:20:50 kettenis Exp $ */ +/* $OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -103,10 +103,10 @@ apic_attach(struct elroy_softc *sc) printf(" APIC ver %x, %d pins", data & APIC_VERSION_MASK, sc->sc_nints); - sc->sc_irq = malloc(sc->sc_nints * sizeof(int), M_DEVBUF, M_NOWAIT); + sc->sc_irq = malloc(sc->sc_nints * sizeof(int), M_DEVBUF, + M_NOWAIT | M_ZERO); if (sc->sc_irq == NULL) panic("apic_attach: cannot allocate irq table\n"); - memset(sc->sc_irq, 0, sc->sc_nints * sizeof(int)); apic_get_int_tbl(sc); diff --git a/sys/arch/hppa/dev/astro.c b/sys/arch/hppa/dev/astro.c index d87a63a4b0e..13c18a086ee 100644 --- a/sys/arch/hppa/dev/astro.c +++ b/sys/arch/hppa/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.7 2007/07/01 12:53:52 kettenis Exp $ */ +/* $OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -589,12 +589,10 @@ iommu_iomap_create(int n) n = 16; ims = malloc(sizeof(*ims) + (n - 1) * sizeof(ims->ims_map.ipm_map[0]), - M_DEVBUF, M_NOWAIT); + M_DEVBUF, M_NOWAIT | M_ZERO); if (ims == NULL) return (NULL); - memset(ims, 0, sizeof *ims); - /* Initialize the map. */ ims->ims_map.ipm_maxpage = n; SPLAY_INIT(&ims->ims_map.ipm_tree); |