diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-03-16 21:00:49 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-03-16 21:00:49 +0000 |
commit | 1c6dce2138fe60a3e62d2e7785bf92434490caa2 (patch) | |
tree | c4877a3c8074f2c777680c6803fcf8abf89a5b47 /sys/arch/sparc64/dev | |
parent | cb824f3107b4afeff1a545c0ef1d88e5a1607de1 (diff) |
Trivial malloc + memset -> malloc(,,M_ZERO) conversion.
As a small bonus this now actually zeroes the whole struct, not just the
non-varying sized part.
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/iommu.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/viommu.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c index 74a79567369..b66a9f8f284 100644 --- a/sys/arch/sparc64/dev/iommu.c +++ b/sys/arch/sparc64/dev/iommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iommu.c,v 1.54 2009/03/16 19:45:32 oga Exp $ */ +/* $OpenBSD: iommu.c,v 1.55 2009/03/16 21:00:48 oga Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -1633,12 +1633,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); diff --git a/sys/arch/sparc64/dev/viommu.c b/sys/arch/sparc64/dev/viommu.c index f7961874dbd..3f6b6160917 100644 --- a/sys/arch/sparc64/dev/viommu.c +++ b/sys/arch/sparc64/dev/viommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viommu.c,v 1.3 2009/03/16 19:45:32 oga Exp $ */ +/* $OpenBSD: viommu.c,v 1.4 2009/03/16 21:00:48 oga Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -914,12 +914,10 @@ viommu_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); |