summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-09-18 00:46:42 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-09-18 00:46:42 +0000
commit29ae8cddb2ec660dd7311cb7bbaea7a920b82c67 (patch)
tree4ca17d15dfa75e34bbfa385be5ade7039b0e906e /sys/dev/ic
parent431db9b83f301f2bf82d88ed2b75bb958f457964 (diff)
Only the most obvious bzero() -> M_ZERO changes. No cast changes, no
MALLOC/FREE, etc. Just adding M_ZERO to malloc() and deleting an immediately adjacent bzero().
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ath.c5
-rw-r--r--sys/dev/ic/ciss.c8
-rw-r--r--sys/dev/ic/i82596.c5
-rw-r--r--sys/dev/ic/pgt.c8
4 files changed, 10 insertions, 16 deletions
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 0936ffc6a1e..1ca938460ad 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.66 2007/07/18 18:10:31 damien Exp $ */
+/* $OpenBSD: ath.c,v 1.67 2007/09/18 00:46:41 krw Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -1613,14 +1613,13 @@ ath_desc_alloc(struct ath_softc *sc)
/* allocate buffers */
bsize = sizeof(struct ath_buf) * (ATH_TXBUF + ATH_RXBUF + 1);
- bf = malloc(bsize, M_DEVBUF, M_NOWAIT);
+ bf = malloc(bsize, M_DEVBUF, M_NOWAIT | M_ZERO);
if (bf == NULL) {
printf("%s: unable to allocate Tx/Rx buffers\n",
sc->sc_dev.dv_xname);
error = ENOMEM;
goto fail3;
}
- bzero(bf, bsize);
sc->sc_bufptr = bf;
TAILQ_INIT(&sc->sc_rxbuf);
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index 260872fc2ba..ced349a564a 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */
+/* $OpenBSD: ciss.c,v 1.28 2007/09/18 00:46:41 krw Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -350,12 +350,11 @@ ciss_attach(struct ciss_softc *sc)
}
if (!(sc->sc_lds = malloc(sc->maxunits * sizeof(*sc->sc_lds),
- M_DEVBUF, M_NOWAIT))) {
+ M_DEVBUF, M_NOWAIT | M_ZERO))) {
bus_dmamem_free(sc->dmat, sc->cmdseg, 1);
bus_dmamap_destroy(sc->dmat, sc->cmdmap);
return -1;
}
- bzero(sc->sc_lds, sc->maxunits * sizeof(*sc->sc_lds));
sc->sc_flush = CISS_FLUSH_ENABLE;
if (!(sc->sc_sh = shutdownhook_establish(ciss_shutdown, sc))) {
@@ -422,9 +421,8 @@ ciss_attach(struct ciss_softc *sc)
sc->sc_flags |= CISS_BIO;
#ifndef SMALL_KERNEL
sc->sensors = malloc(sizeof(struct ksensor) * sc->maxunits,
- M_DEVBUF, M_NOWAIT);
+ M_DEVBUF, M_NOWAIT | M_ZERO);
if (sc->sensors) {
- bzero(sc->sensors, sizeof(struct ksensor) * sc->maxunits);
strlcpy(sc->sensordev.xname, sc->sc_dev.dv_xname,
sizeof(sc->sensordev.xname));
for (i = 0; i < sc->maxunits;
diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c
index 70f22039b3d..68b5fa015e8 100644
--- a/sys/dev/ic/i82596.c
+++ b/sys/dev/ic/i82596.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82596.c,v 1.27 2007/09/10 06:12:59 kettenis Exp $ */
+/* $OpenBSD: i82596.c,v 1.28 2007/09/18 00:46:41 krw Exp $ */
/* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */
/*-
@@ -325,13 +325,12 @@ i82596_attach(sc, name, etheraddr, media, nmedia, defmedia)
if (padbuf == NULL) {
padbuf = malloc(ETHER_MIN_LEN - ETHER_CRC_LEN, M_DEVBUF,
- M_NOWAIT);
+ M_NOWAIT | M_ZERO);
if (padbuf == NULL) {
printf("%s: can't allocate pad buffer\n",
sc->sc_dev.dv_xname);
return;
}
- bzero(padbuf, ETHER_MIN_LEN - ETHER_CRC_LEN);
}
/* Attach the interface. */
diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c
index 674172fa6b0..f5652536c8c 100644
--- a/sys/dev/ic/pgt.c
+++ b/sys/dev/ic/pgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pgt.c,v 1.44 2007/08/28 18:34:38 deraadt Exp $ */
+/* $OpenBSD: pgt.c,v 1.45 2007/09/18 00:46:41 krw Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -1812,9 +1812,8 @@ pgt_ieee80211_node_alloc(struct ieee80211com *ic)
{
struct pgt_ieee80211_node *pin;
- pin = malloc(sizeof(*pin), M_DEVBUF, M_NOWAIT);
+ pin = malloc(sizeof(*pin), M_DEVBUF, M_NOWAIT | M_ZERO);
if (pin != NULL) {
- bzero(pin, sizeof *pin);
pin->pin_dot1x_auth = PIN_DOT1X_UNAUTHORIZED;
}
return (struct ieee80211_node *)pin;
@@ -2284,8 +2283,7 @@ pgt_ioctl(struct ifnet *ifp, u_long cmd, caddr_t req)
case SIOCG80211ALLNODES: {
struct ieee80211_nodereq *nr = NULL;
na = (struct ieee80211_nodereq_all *)req;
- wreq = malloc(sizeof(*wreq), M_DEVBUF, M_WAITOK);
- bzero(wreq, sizeof(*wreq));
+ wreq = malloc(sizeof(*wreq), M_DEVBUF, M_WAITOK | M_ZERO);
maxscan = PGT_OBJ_BSSLIST_NBSS;
pob = malloc(sizeof(*pob) +