diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2000-12-08 21:51:06 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2000-12-08 21:51:06 +0000 |
commit | dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch) | |
tree | 197ae73617ae75afe008897f6906b84835589ea2 /sys/pc98 | |
parent | ed5dbfbd3cd619638a7baac288f548aa1398edac (diff) | |
download | FreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.zip FreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.tar.gz |
Convert more malloc+bzero to malloc+M_ZERO.
Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/cbus/fdc.c | 3 | ||||
-rw-r--r-- | sys/pc98/i386/userconfig.c | 4 | ||||
-rw-r--r-- | sys/pc98/pc98/fd.c | 3 | ||||
-rw-r--r-- | sys/pc98/pc98/syscons.c | 3 | ||||
-rw-r--r-- | sys/pc98/pc98/wd.c | 6 | ||||
-rw-r--r-- | sys/pc98/pc98/wd_cd.c | 9 | ||||
-rw-r--r-- | sys/pc98/pc98/wfd.c | 3 | ||||
-rw-r--r-- | sys/pc98/pc98/wst.c | 3 |
8 files changed, 12 insertions, 22 deletions
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index a58019b..1b21f64 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -1027,10 +1027,9 @@ fdc_add_child(device_t dev, const char *name, int unit) struct fdc_ivars *ivar; device_t child; - ivar = malloc(sizeof *ivar, M_DEVBUF /* XXX */, M_NOWAIT); + ivar = malloc(sizeof *ivar, M_DEVBUF /* XXX */, M_NOWAIT | M_ZERO); if (ivar == NULL) return; - bzero(ivar, sizeof *ivar); if (resource_int_value(name, unit, "drive", &ivar->fdunit) != 0) ivar->fdunit = 0; child = device_add_child(dev, name, unit); diff --git a/sys/pc98/i386/userconfig.c b/sys/pc98/i386/userconfig.c index 4ded4f7..aa3a798 100644 --- a/sys/pc98/i386/userconfig.c +++ b/sys/pc98/i386/userconfig.c @@ -3257,8 +3257,8 @@ load_devtab(void) char *name; int unit; - uc_devtab = malloc(sizeof(struct uc_device)*(count + 1),M_DEVL,M_WAITOK); - bzero(uc_devtab, sizeof(struct uc_device) * (count + 1)); + uc_devtab = malloc(sizeof(struct uc_device) * (count + 1), M_DEVL, + M_WAITOK | M_ZERO); dt = 0; for (i = 0; i < count; i++) { name = resource_query_name(i); diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index a58019b..1b21f64 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -1027,10 +1027,9 @@ fdc_add_child(device_t dev, const char *name, int unit) struct fdc_ivars *ivar; device_t child; - ivar = malloc(sizeof *ivar, M_DEVBUF /* XXX */, M_NOWAIT); + ivar = malloc(sizeof *ivar, M_DEVBUF /* XXX */, M_NOWAIT | M_ZERO); if (ivar == NULL) return; - bzero(ivar, sizeof *ivar); if (resource_int_value(name, unit, "drive", &ivar->fdunit) != 0) ivar->fdunit = 0; child = device_add_child(dev, name, unit); diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c index 3bdc003..554432d 100644 --- a/sys/pc98/pc98/syscons.c +++ b/sys/pc98/pc98/syscons.c @@ -2563,8 +2563,7 @@ scinit(int unit, int flags) kernel_default.rev_color); } else { /* assert(sc_malloc) */ - sc->dev = malloc(sizeof(dev_t)*sc->vtys, M_DEVBUF, M_WAITOK); - bzero(sc->dev, sizeof(dev_t)*sc->vtys); + sc->dev = malloc(sizeof(dev_t)*sc->vtys, M_DEVBUF, M_WAITOK|M_ZERO); sc->dev[0] = makedev(CDEV_MAJOR, unit*MAXCONS); sc->dev[0]->si_tty = ttymalloc(sc->dev[0]->si_tty); scp = alloc_scp(sc, sc->first_vty); diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index 7f6ebe0..3b96e817 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -302,10 +302,9 @@ wdprobe(struct isa_device *dvp) if (unit >= NWDC) return (0); - du = malloc(sizeof *du, M_TEMP, M_NOWAIT); + du = malloc(sizeof *du, M_TEMP, M_NOWAIT | M_ZERO); if (du == NULL) return (0); - bzero(du, sizeof *du); du->dk_ctrlr = dvp->id_unit; interface = du->dk_ctrlr / 2; du->dk_interface = interface; @@ -511,14 +510,13 @@ wdattach(struct isa_device *dvp) if (resource_int_value("wd", lunit, "flags", &flags) != 0) flags = 0; - du = malloc(sizeof *du, M_TEMP, M_NOWAIT); + du = malloc(sizeof *du, M_TEMP, M_NOWAIT | M_ZERO); if (du == NULL) continue; if (wddrives[lunit] != NULL) panic("drive attached twice"); wddrives[lunit] = du; bioq_init(&drive_queue[lunit]); - bzero(du, sizeof *du); du->dk_ctrlr = dvp->id_unit; if (eide_quirks & Q_CMD640B) { du->dk_ctrlr_cmd640 = PRIMARY; diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c index 14b7f6c..f1cca1b 100644 --- a/sys/pc98/pc98/wd_cd.c +++ b/sys/pc98/pc98/wd_cd.c @@ -107,9 +107,8 @@ acd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun, { struct acd *ptr; - if (!(ptr = malloc(sizeof(struct acd), M_TEMP, M_NOWAIT))) + if (!(ptr = malloc(sizeof(struct acd), M_TEMP, M_NOWAIT | M_ZERO))) return NULL; - bzero(ptr, sizeof(struct acd)); bioq_init(&ptr->bio_queue); ptr->ata = ata; ptr->unit = unit; @@ -123,9 +122,8 @@ acd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun, ptr->changer_info = NULL; if (device_stats == NULL) { if (!(ptr->device_stats = malloc(sizeof(struct devstat), - M_TEMP, M_NOWAIT))) + M_TEMP, M_NOWAIT | M_ZERO))) return NULL; - bzero(ptr->device_stats, sizeof(struct devstat)); } else ptr->device_stats = device_stats; @@ -199,12 +197,11 @@ acdattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug) char string[16]; struct acd *tmpcdp = cdp; - chp = malloc(sizeof(struct changer), M_TEMP, M_NOWAIT); + chp = malloc(sizeof(struct changer), M_TEMP, M_NOWAIT | M_ZERO); if (chp == NULL) { printf("wcd: out of memory\n"); return 0; } - bzero(chp, sizeof(struct changer)); result = atapi_request_immediate(ata, unit, ATAPI_MECH_STATUS, 0, 0, 0, 0, 0, 0, 0, sizeof(struct changer)>>8, diff --git a/sys/pc98/pc98/wfd.c b/sys/pc98/pc98/wfd.c index 439769f..2ead84e 100644 --- a/sys/pc98/pc98/wfd.c +++ b/sys/pc98/pc98/wfd.c @@ -180,13 +180,12 @@ wfdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug) printf("wfd: check `options ATAPI_STATIC' in your kernel config file!\n"); return (0); } - t = malloc (sizeof (struct wfd), M_TEMP, M_NOWAIT); + t = malloc (sizeof (struct wfd), M_TEMP, M_NOWAIT | M_ZERO); if (! t) { printf ("wfd: out of memory\n"); return (0); } wfdtab[wfdnlun] = t; - bzero (t, sizeof (struct wfd)); bioq_init(&t->buf_queue); t->ata = ata; t->unit = unit; diff --git a/sys/pc98/pc98/wst.c b/sys/pc98/pc98/wst.c index 3e34a38..3260471 100644 --- a/sys/pc98/pc98/wst.c +++ b/sys/pc98/pc98/wst.c @@ -235,13 +235,12 @@ wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug) "wst: check `options ATAPI_STATIC' in your kernel config file!\n"); return(-1); } - t = malloc(sizeof(struct wst), M_TEMP, M_NOWAIT); + t = malloc(sizeof(struct wst), M_TEMP, M_NOWAIT | M_ZERO); if (!t) { printf("wst: out of memory\n"); return(-1); } wsttab[wstnlun] = t; - bzero(t, sizeof(struct wst)); bioq_init(&t->buf_queue); t->ata = ata; t->unit = unit; |