summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_openbsdkintf.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-09-09 16:50:24 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-09-09 16:50:24 +0000
commitdb0a8a77ed55dc3936f22e404c97f7fa57ea1b49 (patch)
treefce5e236707dd8a951f9376afb277c71032e5e68 /sys/dev/raidframe/rf_openbsdkintf.c
parent69660582124d73b68700fe04ac7349b2e5eb7787 (diff)
The obvious bzero/memset -> M_ZERO changes.
Diffstat (limited to 'sys/dev/raidframe/rf_openbsdkintf.c')
-rw-r--r--sys/dev/raidframe/rf_openbsdkintf.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c
index 02c9c6ce792..ea77f766d01 100644
--- a/sys/dev/raidframe/rf_openbsdkintf.c
+++ b/sys/dev/raidframe/rf_openbsdkintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_openbsdkintf.c,v 1.42 2007/06/23 03:11:34 krw Exp $ */
+/* $OpenBSD: rf_openbsdkintf.c,v 1.43 2007/09/09 16:50:23 krw Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */
/*-
@@ -388,25 +388,20 @@ raidattach(int num)
* This lets us lock the device and what-not when it gets opened.
*/
- raid_softc = (struct raid_softc *)
- malloc(num * sizeof(struct raid_softc), M_RAIDFRAME, M_NOWAIT);
+ raid_softc = malloc(num * sizeof(struct raid_softc), M_RAIDFRAME,
+ M_NOWAIT | M_ZERO);
if (raid_softc == NULL) {
printf("WARNING: no memory for RAIDframe driver\n");
return;
}
- bzero(raid_softc, num * sizeof (struct raid_softc));
-
- raid_scPtrs = (struct raid_softc **)
- malloc(num * sizeof(struct raid_softc *), M_RAIDFRAME,
- M_NOWAIT);
+ raid_scPtrs = malloc(num * sizeof(struct raid_softc *), M_RAIDFRAME,
+ M_NOWAIT | M_ZERO);
if (raid_scPtrs == NULL) {
printf("WARNING: no memory for RAIDframe driver\n");
return;
}
- bzero(raid_scPtrs, num * sizeof (struct raid_softc *));
-
raidrootdev = (struct device *)malloc(num * sizeof(struct device),
M_RAIDFRAME, M_NOWAIT);
if (raidrootdev == NULL) {
@@ -1649,12 +1644,11 @@ raidinit(RF_Raid_t *raidPtr)
* config_attach the raid device into the device tree.
* For autoconf rootdev selection...
*/
- cf = malloc(sizeof(struct cfdata), M_RAIDFRAME, M_NOWAIT);
+ cf = malloc(sizeof(struct cfdata), M_RAIDFRAME, M_NOWAIT | M_ZERO);
if (cf == NULL) {
printf("WARNING: no memory for cfdata struct\n");
return;
}
- bzero(cf, sizeof(struct cfdata));
cf->cf_attach = &raid_ca;
cf->cf_driver = &raid_cd;
@@ -3424,16 +3418,13 @@ rf_auto_config_set(RF_ConfigSet_t *cset, int *unit)
/* 1. Create a config structure. */
- config = (RF_Config_t *)malloc(sizeof(RF_Config_t), M_RAIDFRAME,
- M_NOWAIT);
+ config = malloc(sizeof(RF_Config_t), M_RAIDFRAME, M_NOWAIT | M_ZERO);
if (config==NULL) {
printf("Out of mem!?!?\n");
/* XXX Do something more intelligent here. */
return(1);
}
- memset(config, 0, sizeof(RF_Config_t));
-
/* XXX raidID needs to be set correctly... */
/*