diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-01 15:34:49 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-01 15:34:49 +0000 |
commit | a730dedabc875f93e81898068b1cccdb9e45cb7c (patch) | |
tree | 059cc27503e1389b0da52a36e3fd0e692e1f24e2 /sys/dev/isa | |
parent | d75aaeaf6b0231dbe849cd06ddac7f63b1e30bcc (diff) |
More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...' where
obvious.
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/fd.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/pckbc_isa.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/seagate.c | 6 |
3 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c index 081819dbdca..3834abd5e89 100644 --- a/sys/dev/isa/fd.c +++ b/sys/dev/isa/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.67 2007/06/20 18:15:46 deraadt Exp $ */ +/* $OpenBSD: fd.c,v 1.68 2007/10/01 15:34:48 krw Exp $ */ /* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */ /*- @@ -1058,11 +1058,10 @@ fdformat(dev, finfo, p) int fd_bsize = FD_BSIZE(fd); /* set up a buffer header for fdstrategy() */ - bp = (struct buf *)malloc(sizeof(struct buf), M_TEMP, M_NOWAIT); + bp = malloc(sizeof(*bp), M_TEMP, M_NOWAIT | M_ZERO); if (bp == NULL) return ENOBUFS; - bzero((void *)bp, sizeof(struct buf)); bp->b_flags = B_BUSY | B_PHYS | B_FORMAT; bp->b_proc = p; bp->b_dev = dev; diff --git a/sys/dev/isa/pckbc_isa.c b/sys/dev/isa/pckbc_isa.c index 63488aab9fb..dd3d9e20b67 100644 --- a/sys/dev/isa/pckbc_isa.c +++ b/sys/dev/isa/pckbc_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc_isa.c,v 1.4 2004/04/02 04:39:51 deraadt Exp $ */ +/* $OpenBSD: pckbc_isa.c,v 1.5 2007/10/01 15:34:48 krw Exp $ */ /* $NetBSD: pckbc_isa.c,v 1.2 2000/03/23 07:01:35 thorpej Exp $ */ /* @@ -148,8 +148,7 @@ pckbc_isa_attach(parent, self, aux) bus_space_map(iot, IO_KBD + KBCMDP, 1, 0, &ioh_c)) panic("pckbc_attach: couldn't map"); - t = malloc(sizeof(struct pckbc_internal), M_DEVBUF, M_WAITOK); - bzero(t, sizeof(struct pckbc_internal)); + t = malloc(sizeof(*t), M_DEVBUF, M_WAITOK | M_ZERO); t->t_iot = iot; t->t_ioh_d = ioh_d; t->t_ioh_c = ioh_c; diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c index 0804e054dd0..a81066e098f 100644 --- a/sys/dev/isa/seagate.c +++ b/sys/dev/isa/seagate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seagate.c,v 1.21 2007/06/29 15:17:02 jasper Exp $ */ +/* $OpenBSD: seagate.c,v 1.22 2007/10/01 15:34:48 krw Exp $ */ /* * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver @@ -624,10 +624,8 @@ sea_get_scb(struct sea_softc *sea, int flags) break; } if (sea->numscbs < SEA_SCB_MAX) { - scb = (struct sea_scb *) malloc(sizeof(struct sea_scb), - M_TEMP, M_NOWAIT); + scb = malloc(sizeof(*scb), M_TEMP, M_NOWAIT | M_ZERO); if (scb) { - bzero(scb, sizeof(struct sea_scb)); sea->numscbs++; } else printf("%s: can't malloc scb\n", |