diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2000-11-18 15:21:22 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2000-11-18 15:21:22 +0000 |
commit | 51c82207610826a4ad7bf626560db6021584440d (patch) | |
tree | 8da5c68a92019b9e37869775fe3a8353617ec207 /sys | |
parent | 918549eb3151450239d659ae968cb9e68b863bfc (diff) | |
download | FreeBSD-src-51c82207610826a4ad7bf626560db6021584440d.zip FreeBSD-src-51c82207610826a4ad7bf626560db6021584440d.tar.gz |
Further use of M_ZERO.
Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>
Approved by: msmith
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/aac/aac.c | 5 | ||||
-rw-r--r-- | sys/dev/amr/amr.c | 3 | ||||
-rw-r--r-- | sys/dev/amr/amr_cam.c | 3 | ||||
-rw-r--r-- | sys/dev/mlx/mlx.c | 3 | ||||
-rw-r--r-- | sys/dev/mly/mly.c | 6 |
5 files changed, 7 insertions, 13 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 87cc9ae..19b57e9 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -920,10 +920,9 @@ aac_alloc_command_cluster(struct aac_softc *sc) debug_called(1); - cmc = malloc(sizeof(struct aac_command_cluster), M_DEVBUF, M_NOWAIT); + cmc = malloc(sizeof(struct aac_command_cluster), M_DEVBUF, + M_NOWAIT | M_ZERO); if (cmc != NULL) { - bzero(cmc, sizeof(*cmc)); - /* allocate the FIB cluster in DMAable memory and load it */ if (bus_dmamem_alloc(sc->aac_fib_dmat, (void **)&cmc->cmc_fibs, BUS_DMA_NOWAIT, &cmc->cmc_fibmap)) { free(cmc, M_DEVBUF); diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index d870df8..7ffe1b1 100644 --- a/sys/dev/amr/amr.c +++ b/sys/dev/amr/amr.c @@ -414,11 +414,10 @@ amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) /* handle SCSI passthrough command */ if (au->au_cmd[0] == AMR_CMD_PASS) { - if ((ap = malloc(sizeof(*ap), M_DEVBUF, M_WAITOK)) == NULL) { + if ((ap = malloc(sizeof(*ap), M_DEVBUF, M_WAITOK | M_ZERO)) == NULL) { error = ENOMEM; break; } - bzero(ap, sizeof(*ap)); /* copy cdb */ ap->ap_cdb_length = au->au_cmd[2]; diff --git a/sys/dev/amr/amr_cam.c b/sys/dev/amr/amr_cam.c index 45ecc52..b8d7be4 100644 --- a/sys/dev/amr/amr_cam.c +++ b/sys/dev/amr/amr_cam.c @@ -319,11 +319,10 @@ amr_cam_command(struct amr_softc *sc, struct amr_command **acp) */ /* construct passthrough */ - if ((ap = malloc(sizeof(*ap), M_DEVBUF, M_NOWAIT)) == NULL) { + if ((ap = malloc(sizeof(*ap), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { error = ENOMEM; goto out; } - bzero(ap, sizeof(*ap)); ap->ap_timeout = 0; ap->ap_ars = 1; ap->ap_request_sense_length = 14; diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 3c69dc5..e5271c9 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -2267,9 +2267,8 @@ mlx_alloccmd(struct mlx_softc *sc) /* allocate a new command buffer? */ if (mc == NULL) { - mc = (struct mlx_command *)malloc(sizeof(*mc), M_DEVBUF, M_NOWAIT); + mc = (struct mlx_command *)malloc(sizeof(*mc), M_DEVBUF, M_NOWAIT | M_ZERO); if (mc != NULL) { - bzero(mc, sizeof(*mc)); mc->mc_sc = sc; error = bus_dmamap_create(sc->mlx_buffer_dmat, 0, &mc->mc_dmamap); if (error) { diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index 91cec9c..71ad591 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -296,11 +296,10 @@ mly_rescan_btl(struct mly_softc *sc, int bus, int target) return; /* we'll be retried soon */ /* set up the data buffer */ - if ((mc->mc_data = malloc(sizeof(union mly_devinfo), M_DEVBUF, M_NOWAIT)) == NULL) { + if ((mc->mc_data = malloc(sizeof(union mly_devinfo), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { mly_release_command(mc); return; /* we'll get retried the next time a command completes */ } - bzero(mc->mc_data, sizeof(union mly_devinfo)); mc->mc_flags |= MLY_CMD_DATAIN; mc->mc_complete = mly_complete_rescan; @@ -589,11 +588,10 @@ mly_fetch_event(struct mly_softc *sc) return; /* we'll get retried the next time a command completes */ /* set up the data buffer */ - if ((mc->mc_data = malloc(sizeof(struct mly_event), M_DEVBUF, M_NOWAIT)) == NULL) { + if ((mc->mc_data = malloc(sizeof(struct mly_event), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { mly_release_command(mc); return; /* we'll get retried the next time a command completes */ } - bzero(mc->mc_data, sizeof(struct mly_event)); mc->mc_length = sizeof(struct mly_event); mc->mc_flags |= MLY_CMD_DATAIN; mc->mc_complete = mly_complete_event; |