summaryrefslogtreecommitdiffstats
path: root/sys/dev/ar
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
committerdwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
commitdd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch)
tree197ae73617ae75afe008897f6906b84835589ea2 /sys/dev/ar
parented5dbfbd3cd619638a7baac288f548aa1398edac (diff)
downloadFreeBSD-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/dev/ar')
-rw-r--r--sys/dev/ar/if_ar.c11
-rw-r--r--sys/dev/ar/if_ar_isa.c11
2 files changed, 8 insertions, 14 deletions
diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c
index dfbc3ac..9acc402 100644
--- a/sys/dev/ar/if_ar.c
+++ b/sys/dev/ar/if_ar.c
@@ -397,8 +397,7 @@ arattach_pci(int unit, vm_offset_t mem_addr)
struct ar_hardc *hc;
u_int i, tmp;
- hc = malloc(sizeof(struct ar_hardc), M_DEVBUF, M_WAITOK);
- bzero(hc, sizeof(struct ar_hardc));
+ hc = malloc(sizeof(struct ar_hardc), M_DEVBUF, M_WAITOK | M_ZERO);
hc->cunit = unit;
hc->mem_start = (caddr_t)mem_addr;
@@ -1139,11 +1138,10 @@ arc_init(struct ar_hardc *hc)
u_int descneeded;
u_char isr, mar;
- MALLOC(sc, struct ar_softc *,
- hc->numports * sizeof(struct ar_softc), M_DEVBUF, M_WAITOK);
+ MALLOC(sc, struct ar_softc *, hc->numports * sizeof(struct ar_softc),
+ M_DEVBUF, M_WAITOK | M_ZERO);
if (sc == NULL)
return;
- bzero(sc, hc->numports * sizeof(struct ar_softc));
hc->sc = sc;
hc->txc_dtr[0] = AR_TXC_DTR_NOTRESET |
@@ -2234,12 +2232,11 @@ ngar_rcvmsg(node_p node, struct ng_mesg *msg,
int pos = 0;
int resplen = sizeof(struct ng_mesg) + 512;
MALLOC(*resp, struct ng_mesg *, resplen,
- M_NETGRAPH, M_NOWAIT);
+ M_NETGRAPH, M_NOWAIT | M_ZERO);
if (*resp == NULL) {
error = ENOMEM;
break;
}
- bzero(*resp, resplen);
arg = (*resp)->data;
/*
diff --git a/sys/dev/ar/if_ar_isa.c b/sys/dev/ar/if_ar_isa.c
index dfbc3ac..9acc402 100644
--- a/sys/dev/ar/if_ar_isa.c
+++ b/sys/dev/ar/if_ar_isa.c
@@ -397,8 +397,7 @@ arattach_pci(int unit, vm_offset_t mem_addr)
struct ar_hardc *hc;
u_int i, tmp;
- hc = malloc(sizeof(struct ar_hardc), M_DEVBUF, M_WAITOK);
- bzero(hc, sizeof(struct ar_hardc));
+ hc = malloc(sizeof(struct ar_hardc), M_DEVBUF, M_WAITOK | M_ZERO);
hc->cunit = unit;
hc->mem_start = (caddr_t)mem_addr;
@@ -1139,11 +1138,10 @@ arc_init(struct ar_hardc *hc)
u_int descneeded;
u_char isr, mar;
- MALLOC(sc, struct ar_softc *,
- hc->numports * sizeof(struct ar_softc), M_DEVBUF, M_WAITOK);
+ MALLOC(sc, struct ar_softc *, hc->numports * sizeof(struct ar_softc),
+ M_DEVBUF, M_WAITOK | M_ZERO);
if (sc == NULL)
return;
- bzero(sc, hc->numports * sizeof(struct ar_softc));
hc->sc = sc;
hc->txc_dtr[0] = AR_TXC_DTR_NOTRESET |
@@ -2234,12 +2232,11 @@ ngar_rcvmsg(node_p node, struct ng_mesg *msg,
int pos = 0;
int resplen = sizeof(struct ng_mesg) + 512;
MALLOC(*resp, struct ng_mesg *, resplen,
- M_NETGRAPH, M_NOWAIT);
+ M_NETGRAPH, M_NOWAIT | M_ZERO);
if (*resp == NULL) {
error = ENOMEM;
break;
}
- bzero(*resp, resplen);
arg = (*resp)->data;
/*
OpenPOWER on IntegriCloud