linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: gregkh@suse.de
Cc: "Roland Vossen" <rvossen@broadcom.com>,
	devel@linuxdriverproject.org, linux-wireless@vger.kernel.org,
	"Brett Rudley" <brudley@broadcom.com>,
	"Henry Ptasinski" <henryp@broadcom.com>
Subject: [PATCH 61/61] staging: brcm80211: removed function wlc_calloc()
Date: Tue, 3 May 2011 11:36:01 +0200	[thread overview]
Message-ID: <1304415361-7813-62-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1304415361-7813-1-git-send-email-arend@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Code cleanup. After the previous patches, this function does not have
any added value anymore.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.c |   62 +++++++++--------------
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.h |    2 -
 drivers/staging/brcm80211/brcmsmac/wlc_main.c  |    2 +-
 3 files changed, 25 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c
index dc43227..d02364b 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c
@@ -43,14 +43,6 @@ static struct wlc_pub *wlc_pub_malloc(uint unit,
 static void wlc_pub_mfree(struct wlc_pub *pub);
 static void wlc_tunables_init(wlc_tunables_t *tunables, uint devid);
 
-void *wlc_calloc(uint unit, uint size)
-{
-	void *item;
-
-	item = kzalloc(size, GFP_ATOMIC);
-	return item;
-}
-
 void wlc_tunables_init(wlc_tunables_t *tunables, uint devid)
 {
 	tunables->ntxd = NTXD;
@@ -73,14 +65,13 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid)
 {
 	struct wlc_pub *pub;
 
-	pub = wlc_calloc(unit, sizeof(struct wlc_pub));
+	pub = kzalloc(sizeof(struct wlc_pub), GFP_ATOMIC);
 	if (pub == NULL) {
 		*err = 1001;
 		goto fail;
 	}
 
-	pub->tunables = wlc_calloc(unit,
-		sizeof(wlc_tunables_t));
+	pub->tunables = kzalloc(sizeof(wlc_tunables_t), GFP_ATOMIC);
 	if (pub->tunables == NULL) {
 		*err = 1028;
 		goto fail;
@@ -89,12 +80,11 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid)
 	/* need to init the tunables now */
 	wlc_tunables_init(pub->tunables, devid);
 
-	pub->_cnt = wlc_calloc(unit, sizeof(struct wl_cnt));
+	pub->_cnt =  kzalloc(sizeof(struct wl_cnt), GFP_ATOMIC);
 	if (pub->_cnt == NULL)
 		goto fail;
 
-	pub->multicast = (u8 *)wlc_calloc(unit,
-		(ETH_ALEN * MAXMULTILIST));
+	pub->multicast = kzalloc(ETH_ALEN * MAXMULTILIST, GFP_ATOMIC);
 	if (pub->multicast == NULL) {
 		*err = 1003;
 		goto fail;
@@ -122,12 +112,11 @@ static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit)
 {
 	struct wlc_bsscfg *cfg;
 
-	cfg = (struct wlc_bsscfg *) wlc_calloc(unit, sizeof(struct wlc_bsscfg));
+	cfg = kzalloc(sizeof(struct wlc_bsscfg), GFP_ATOMIC);
 	if (cfg == NULL)
 		goto fail;
 
-	cfg->current_bss = (wlc_bss_info_t *)wlc_calloc(unit,
-		sizeof(wlc_bss_info_t));
+	cfg->current_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
 	if (cfg->current_bss == NULL)
 		goto fail;
 
@@ -161,7 +150,7 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 {
 	struct wlc_info *wlc;
 
-	wlc = (struct wlc_info *) wlc_calloc(unit, sizeof(struct wlc_info));
+	wlc = kzalloc(sizeof(struct wlc_info), GFP_ATOMIC);
 	if (wlc == NULL) {
 		*err = 1002;
 		goto fail;
@@ -179,16 +168,15 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 
 	/* allocate struct wlc_hw_info state structure */
 
-	wlc->hw = (struct wlc_hw_info *)wlc_calloc(unit,
-			sizeof(struct wlc_hw_info));
+	wlc->hw = kzalloc(sizeof(struct wlc_hw_info), GFP_ATOMIC);
 	if (wlc->hw == NULL) {
 		*err = 1005;
 		goto fail;
 	}
 	wlc->hw->wlc = wlc;
 
-	wlc->hw->bandstate[0] = wlc_calloc(unit,
-		(sizeof(struct wlc_hwband) * MAXBANDS));
+	wlc->hw->bandstate[0] =
+		kzalloc(sizeof(struct wlc_hwband) * MAXBANDS, GFP_ATOMIC);
 	if (wlc->hw->bandstate[0] == NULL) {
 		*err = 1006;
 		goto fail;
@@ -202,15 +190,14 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 		}
 	}
 
-	wlc->modulecb = wlc_calloc(unit,
-		sizeof(struct modulecb) * WLC_MAXMODULES);
+	wlc->modulecb =
+		kzalloc(sizeof(struct modulecb) * WLC_MAXMODULES, GFP_ATOMIC);
 	if (wlc->modulecb == NULL) {
 		*err = 1009;
 		goto fail;
 	}
 
-	wlc->default_bss = (wlc_bss_info_t *)wlc_calloc(unit,
-		sizeof(wlc_bss_info_t));
+	wlc->default_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
 	if (wlc->default_bss == NULL) {
 		*err = 1010;
 		goto fail;
@@ -223,15 +210,16 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 	}
 	wlc_bsscfg_ID_assign(wlc, wlc->cfg);
 
-	wlc->pkt_callback = wlc_calloc(unit,
-		(sizeof(struct pkt_cb) * (wlc->pub->tunables->maxpktcb + 1)));
+	wlc->pkt_callback = kzalloc(sizeof(struct pkt_cb) *
+				    (wlc->pub->tunables->maxpktcb + 1),
+				    GFP_ATOMIC);
 	if (wlc->pkt_callback == NULL) {
 		*err = 1013;
 		goto fail;
 	}
 
-	wlc->wsec_def_keys[0] = (wsec_key_t *)wlc_calloc(unit,
-		(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS));
+	wlc->wsec_def_keys[0] =
+		kzalloc(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
 	if (wlc->wsec_def_keys[0] == NULL) {
 		*err = 1015;
 		goto fail;
@@ -244,21 +232,20 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 		}
 	}
 
-	wlc->protection = wlc_calloc(unit,
-		sizeof(struct wlc_protection));
+	wlc->protection = kzalloc(sizeof(struct wlc_protection), GFP_ATOMIC);
 	if (wlc->protection == NULL) {
 		*err = 1016;
 		goto fail;
 	}
 
-	wlc->stf = wlc_calloc(unit, sizeof(struct wlc_stf));
+	wlc->stf = kzalloc(sizeof(struct wlc_stf), GFP_ATOMIC);
 	if (wlc->stf == NULL) {
 		*err = 1017;
 		goto fail;
 	}
 
-	wlc->bandstate[0] = (struct wlcband *)wlc_calloc(unit,
-				(sizeof(struct wlcband)*MAXBANDS));
+	wlc->bandstate[0] =
+		kzalloc(sizeof(struct wlcband)*MAXBANDS, GFP_ATOMIC);
 	if (wlc->bandstate[0] == NULL) {
 		*err = 1025;
 		goto fail;
@@ -272,15 +259,14 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 		}
 	}
 
-	wlc->corestate = (struct wlccore *)wlc_calloc(unit,
-						      sizeof(struct wlccore));
+	wlc->corestate = kzalloc(sizeof(struct wlccore), GFP_ATOMIC);
 	if (wlc->corestate == NULL) {
 		*err = 1026;
 		goto fail;
 	}
 
 	wlc->corestate->macstat_snapshot =
-		(macstat_t *)wlc_calloc(unit, sizeof(macstat_t));
+		kzalloc(sizeof(macstat_t), GFP_ATOMIC);
 	if (wlc->corestate->macstat_snapshot == NULL) {
 		*err = 1027;
 		goto fail;
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h
index 1fb7430..95f951e 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h
@@ -14,7 +14,5 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-extern void *wlc_calloc(uint unit, uint size);
-
 extern struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
 extern void wlc_detach_mfree(struct wlc_info *wlc);
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c b/drivers/staging/brcm80211/brcmsmac/wlc_main.c
index 6edaa09..4d8fa34 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c
@@ -8040,7 +8040,7 @@ static struct wlc_txq_info *wlc_txq_alloc(struct wlc_info *wlc)
 {
 	struct wlc_txq_info *qi, *p;
 
-	qi = wlc_calloc(wlc->pub->unit, sizeof(struct wlc_txq_info));
+	qi = kzalloc(sizeof(struct wlc_txq_info), GFP_ATOMIC);
 	if (qi != NULL) {
 		/*
 		 * Have enough room for control packets along with HI watermark
-- 
1.7.4.1



      parent reply	other threads:[~2011-05-03  9:37 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03  9:35 [PATCH 00/61] staging: brcm80211: resubmit after flush of patch queue Arend van Spriel
2011-05-03  9:35 ` [PATCH 01/61] staging: brcm80211: fixed error in non-DHD_DEBUG fullmac build Arend van Spriel
2011-05-03  9:35 ` [PATCH 02/61] staging: brcm80211: made error codes in bcmutils.h positive Arend van Spriel
2011-05-03  9:35 ` [PATCH 03/61] staging: brcm80211: bugfix for fullmac return codes Arend van Spriel
2011-05-03  9:35 ` [PATCH 04/61] staging: brcm80211: removed WL_NONE Arend van Spriel
2011-05-03  9:35 ` [PATCH 05/61] staging: brcm80211: making wiphy object accessible from wlc and phy Arend van Spriel
2011-05-03  9:35 ` [PATCH 06/61] staging: brcm80211: replaced WL_ERROR in two files Arend van Spriel
2011-05-03  9:35 ` [PATCH 07/61] staging: brcm80211: replaced WL_ERROR in wlc_ampdu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 08/61] staging: brcm80211: replaced WL_ERROR in wlc_bmac.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 09/61] staging: brcm80211: replaced WL_ERROR in wlc_main.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 10/61] staging: brcm80211: replaced WL_ERROR in rest of softmac Arend van Spriel
2011-05-03  9:35 ` [PATCH 11/61] staging: brcm80211: remove unnecessary if statements from bss_info_changed Arend van Spriel
2011-05-03  9:35 ` [PATCH 12/61] staging: brcm80211: remove wl_ops_set_rts_threshold Arend van Spriel
2011-05-03  9:35 ` [PATCH 13/61] staging: brcm80211: rename rate related definitions Arend van Spriel
2011-05-03  9:35 ` [PATCH 14/61] staging: brcm80211: honour basic rate configuration from mac80211 Arend van Spriel
2011-05-03  9:35 ` [PATCH 15/61] staging: brcm80211: removed ASSERTs from wlc_main.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 16/61] staging: brcm80211: removed ASSERTs from wlc_ampdu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 17/61] staging: brcm80211: removed ASSERTs from wlc_bmac.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 18/61] staging: brcm80211: removed error string function Arend van Spriel
2011-05-03  9:35 ` [PATCH 19/61] staging: brcm80211: replace error codes part 1 Arend van Spriel
2011-05-03  9:35 ` [PATCH 20/61] staging: brcm80211: replace error codes part 2 Arend van Spriel
2011-05-03  9:35 ` [PATCH 21/61] staging: brcm80211: made fullmac error codes more consistent Arend van Spriel
2011-05-03  9:35 ` [PATCH 22/61] staging: brcm80211: removed ASSERTs from util dir, part 1 Arend van Spriel
2011-05-03  9:35 ` [PATCH 23/61] staging: brcm80211: removed ASSERTs from util dir, part 2 Arend van Spriel
2011-05-03  9:35 ` [PATCH 24/61] staging: brcm80211: delete ASSERTs in 4 files in brcmsmac dir Arend van Spriel
2011-05-03  9:35 ` [PATCH 25/61] staging: brcm80211: removed all ASSERTs from wl_mac80211.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 26/61] staging: brcm80211: removed all ASSERTs from wlc_ampdu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 27/61] staging: brcm80211: removed remaining ASSERTs from phy Arend van Spriel
2011-05-03  9:35 ` [PATCH 28/61] staging: brcm80211: implement flush driver callback for mac80211 Arend van Spriel
2011-05-03  9:35 ` [PATCH 29/61] staging: brcm80211: rename active_queue identifier Arend van Spriel
2011-05-03  9:35 ` [PATCH 30/61] staging: brcm80211: remove queue info parameter from wlc_send_q Arend van Spriel
2011-05-03  9:35 ` [PATCH 31/61] staging: brcm80211: provide TSF value in receive status Arend van Spriel
2011-05-03  9:35 ` [PATCH 32/61] staging: brcm80211: remove tsf retrieval from wlc_bmac.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 33/61] staging: brcm80211: remove retrieval function for tsf in wlc_main.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 34/61] Revert "staging: brcm80211: separate hndpmu functionality for brcmsmac driver" Arend van Spriel
2011-05-03  9:35 ` [PATCH 35/61] staging: brcm80211: remove unused functions from hndpmu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 36/61] staging: brcm80211: remove use of si_* functions from wlc_phy_lcn.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 37/61] staging: brcm80211: separate hndpmu functionality for brcmsmac driver Arend van Spriel
2011-05-03  9:35 ` [PATCH 38/61] staging: brcm80211: remove dependency between aiutils and siutils sources Arend van Spriel
2011-05-03  9:35 ` [PATCH 39/61] staging: brcm80211: fix checkpatch warnings in si_pmu_spuravoid_pllupdate Arend van Spriel
2011-05-03  9:35 ` [PATCH 40/61] staging: brcm80211: remove zero initialization of static in si_pmu_ilp_clock Arend van Spriel
2011-05-03  9:35 ` [PATCH 41/61] staging: brcm80211: fix checkpatch warning in si_pmu_res_init Arend van Spriel
2011-05-03  9:35 ` [PATCH 42/61] staging: brcm80211: fix checkpatch issues in si_pmu_measure_alpclk Arend van Spriel
2011-05-03  9:35 ` [PATCH 43/61] staging: brcm80211: fix checkpatch warning in si_pmu_otp_power Arend van Spriel
2011-05-03  9:35 ` [PATCH 44/61] staging: brcm80211: cleanup definitions in aiutils header file Arend van Spriel
2011-05-03  9:35 ` [PATCH 45/61] staging: brcm80211: cleanup code in source file aiutils.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 46/61] staging: brcm80211: move aiutils source files to brcmsmac folder Arend van Spriel
2011-05-03  9:35 ` [PATCH 47/61] staging: brcm80211: remove check on interconnect type in ai_setcore Arend van Spriel
2011-05-03  9:35 ` [PATCH 48/61] staging: brcm80211: use local variable for socitype during ai_scan Arend van Spriel
2011-05-03  9:35 ` [PATCH 49/61] staging: brcm80211: remove socitype member for struct si_pub definition Arend van Spriel
2011-05-03  9:35 ` [PATCH 50/61] staging: brcm80211: removed ASSERTs from aiutils.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 51/61] staging: brcm80211: removed ASSERTs from wlc_pmu.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 52/61] staging: brcm80211: moved ASSERT logic to fullmac driver Arend van Spriel
2011-05-03  9:35 ` [PATCH 53/61] staging: brcm80211: replace hndcrc16 with crc-ccitt function Arend van Spriel
2011-05-03  9:35 ` [PATCH 54/61] staging: brcm80211: remove unused hndcrc32 function Arend van Spriel
2011-05-03  9:35 ` [PATCH 55/61] staging: brcm80211: remove CRC_INNER_LOOP macro Arend van Spriel
2011-05-03  9:35 ` [PATCH 56/61] staging: brcm80211: move qmath sources to phy directory Arend van Spriel
2011-05-03  9:35 ` [PATCH 57/61] staging: brcm80211: remove unused functions from wlc_phy_qmath.c Arend van Spriel
2011-05-03  9:35 ` [PATCH 58/61] staging: brcm80211: replaced WL_TRACE by BCMMSG Arend van Spriel
2011-05-03  9:35 ` [PATCH 59/61] staging: brcm80211: replaced WL_AMPDU_* with BCMMSG Arend van Spriel
2011-05-03  9:36 ` [PATCH 60/61] staging: brcm80211: got rid of WL_FFPLD message log macro Arend van Spriel
2011-05-03  9:36 ` Arend van Spriel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304415361-7813-62-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=brudley@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=henryp@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rvossen@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).