diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-01 16:11:20 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-01 16:11:20 +0000 |
commit | 1d3a2c7615ad6b5663e200fe3e8a475ef3203245 (patch) | |
tree | de1c38fdba408d50ca09e62ce6c6e40d21d28491 /sys/arch/vax | |
parent | a730dedabc875f93e81898068b1cccdb9e45cb7c (diff) |
More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...' where
obvious.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/vsa/lcg.c | 5 | ||||
-rw-r--r-- | sys/arch/vax/vsa/lcspx.c | 5 | ||||
-rw-r--r-- | sys/arch/vax/vsa/smg.c | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/sys/arch/vax/vsa/lcg.c b/sys/arch/vax/vsa/lcg.c index d06f34fb6d6..a6c7eafccf1 100644 --- a/sys/arch/vax/vsa/lcg.c +++ b/sys/arch/vax/vsa/lcg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lcg.c,v 1.10 2006/11/29 12:13:54 miod Exp $ */ +/* $OpenBSD: lcg.c,v 1.11 2007/10/01 16:11:19 krw Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -247,12 +247,11 @@ lcg_attach(struct device *parent, struct device *self, void *aux) ss = &lcg_consscr; sc->sc_nscreens = 1; } else { - ss = malloc(sizeof(struct lcg_screen), M_DEVBUF, M_NOWAIT); + ss = malloc(sizeof(*ss), M_DEVBUF, M_NOWAIT | M_ZERO); if (ss == NULL) { printf(": can not allocate memory\n"); return; } - bzero(ss, sizeof(struct lcg_screen)); ss->ss_cfg = cfg; ss->ss_depth = lcg_probe_screen(ss->ss_cfg, diff --git a/sys/arch/vax/vsa/lcspx.c b/sys/arch/vax/vsa/lcspx.c index df4d91c8a03..818557f6837 100644 --- a/sys/arch/vax/vsa/lcspx.c +++ b/sys/arch/vax/vsa/lcspx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lcspx.c,v 1.11 2006/11/29 12:13:54 miod Exp $ */ +/* $OpenBSD: lcspx.c,v 1.12 2007/10/01 16:11:19 krw Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -232,12 +232,11 @@ lcspx_attach(struct device *parent, struct device *self, void *aux) ss = &lcspx_consscr; sc->sc_nscreens = 1; } else { - ss = malloc(sizeof(struct lcspx_screen), M_DEVBUF, M_NOWAIT); + ss = malloc(sizeof(*ss), M_DEVBUF, M_NOWAIT | M_ZERO); if (ss == NULL) { printf(": can not allocate memory\n"); return; } - bzero(ss, sizeof(struct lcspx_screen)); ss->ss_addr = (caddr_t)vax_map_physmem(LCSPX_FB_ADDR, LCSPX_FBSIZE / VAX_NBPG); diff --git a/sys/arch/vax/vsa/smg.c b/sys/arch/vax/vsa/smg.c index 67c66093edb..3f0fc6ef40c 100644 --- a/sys/arch/vax/vsa/smg.c +++ b/sys/arch/vax/vsa/smg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smg.c,v 1.19 2006/11/29 19:08:22 miod Exp $ */ +/* $OpenBSD: smg.c,v 1.20 2007/10/01 16:11:19 krw Exp $ */ /* $NetBSD: smg.c,v 1.21 2000/03/23 06:46:44 thorpej Exp $ */ /* * Copyright (c) 2006, Miodrag Vallat @@ -283,12 +283,11 @@ smg_attach(struct device *parent, struct device *self, void *aux) scr = &smg_consscr; sc->sc_nscreens = 1; } else { - scr = malloc(sizeof(struct smg_screen), M_DEVBUF, M_NOWAIT); + scr = malloc(sizeof(*scr), M_DEVBUF, M_NOWAIT | M_ZERO); if (scr == NULL) { printf(": can not allocate memory\n"); return; } - bzero(scr, sizeof(struct smg_screen)); scr->ss_addr = (caddr_t)vax_map_physmem(SMADDR, SMSIZE / VAX_NBPG); |