diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2007-09-07 19:05:06 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2007-09-07 19:05:06 +0000 |
commit | d129be97b55680517d1ece36497d0968d019655e (patch) | |
tree | b488a982f0f7a0e0adc56f816efa6082c5d3d372 /sys/dev/pci | |
parent | 9dcfd606dedda51e51c48b2bd2f2fa322a947a6a (diff) |
use new malloc M_ZERO flag to shrink kernel.
remove <malloc.h> from files where malloc is not used.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/if_iwn.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/if_nfe.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 13 |
5 files changed, 9 insertions, 26 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 4c74546ddf1..1df56e0435f 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.68 2007/08/28 18:34:38 deraadt Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.69 2007/09/07 19:05:05 damien Exp $ */ /*- * Copyright (c) 2004-2006 @@ -40,7 +40,6 @@ #include <sys/kernel.h> #include <sys/socket.h> #include <sys/systm.h> -#include <sys/malloc.h> #include <sys/conf.h> #include <sys/device.h> diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 9fffd6ed341..3ff94e961e2 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.84 2007/08/28 18:34:38 deraadt Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.85 2007/09/07 19:05:05 damien Exp $ */ /*- * Copyright (c) 2004-2006 @@ -40,7 +40,6 @@ #include <sys/kernel.h> #include <sys/socket.h> #include <sys/systm.h> -#include <sys/malloc.h> #include <sys/conf.h> #include <sys/device.h> diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 9f321fa8f7c..1a075c1cd2d 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.3 2007/09/06 19:33:20 damien Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.4 2007/09/07 19:05:05 damien Exp $ */ /*- * Copyright (c) 2007 @@ -688,15 +688,13 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int count, } ring->data = malloc(count * sizeof (struct iwn_tx_data), M_DEVBUF, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (ring->data == NULL) { printf("%s: could not allocate tx data slots\n", sc->sc_dev.dv_xname); goto fail; } - memset(ring->data, 0, count * sizeof (struct iwn_tx_data)); - for (i = 0; i < count; i++) { struct iwn_tx_data *data = &ring->data[i]; @@ -777,12 +775,7 @@ iwn_free_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring) struct ieee80211_node * iwn_node_alloc(struct ieee80211com *ic) { - struct iwn_node *wn; - - wn = malloc(sizeof (struct iwn_node), M_DEVBUF, M_NOWAIT); - if (wn != NULL) - memset(wn, 0, sizeof (struct iwn_node)); - return (struct ieee80211_node *)wn; + return malloc(sizeof (struct iwn_node), M_DEVBUF, M_NOWAIT | M_ZERO); } void diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 4e959ec392e..d7555071272 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.70 2007/09/01 19:19:39 ckuethe Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.71 2007/09/07 19:05:05 damien Exp $ */ /*- * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr> @@ -29,7 +29,6 @@ #include <sys/sockio.h> #include <sys/mbuf.h> #include <sys/queue.h> -#include <sys/malloc.h> #include <sys/kernel.h> #include <sys/device.h> #include <sys/timeout.h> diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 50bd2faddd1..11255d214c5 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.52 2007/08/28 18:34:38 deraadt Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.53 2007/09/07 19:05:05 damien Exp $ */ /*- * Copyright (c) 2006, 2007 @@ -648,15 +648,13 @@ wpi_alloc_tx_ring(struct wpi_softc *sc, struct wpi_tx_ring *ring, int count, } ring->data = malloc(count * sizeof (struct wpi_tx_data), M_DEVBUF, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (ring->data == NULL) { printf("%s: could not allocate tx data slots\n", sc->sc_dev.dv_xname); goto fail; } - memset(ring->data, 0, count * sizeof (struct wpi_tx_data)); - for (i = 0; i < count; i++) { struct wpi_tx_data *data = &ring->data[i]; @@ -735,12 +733,7 @@ wpi_free_tx_ring(struct wpi_softc *sc, struct wpi_tx_ring *ring) struct ieee80211_node * wpi_node_alloc(struct ieee80211com *ic) { - struct wpi_node *wn; - - wn = malloc(sizeof (struct wpi_node), M_DEVBUF, M_NOWAIT); - if (wn != NULL) - memset(wn, 0, sizeof (struct wpi_node)); - return (struct ieee80211_node *)wn; + return malloc(sizeof (struct wpi_node), M_DEVBUF, M_NOWAIT | M_ZERO); } void |