Commit 56aec662 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: removed function wlc_calloc()

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: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e0c6bf13
...@@ -43,14 +43,6 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, ...@@ -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_pub_mfree(struct wlc_pub *pub);
static void wlc_tunables_init(wlc_tunables_t *tunables, uint devid); 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) void wlc_tunables_init(wlc_tunables_t *tunables, uint devid)
{ {
tunables->ntxd = NTXD; tunables->ntxd = NTXD;
...@@ -73,14 +65,13 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid) ...@@ -73,14 +65,13 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid)
{ {
struct wlc_pub *pub; struct wlc_pub *pub;
pub = wlc_calloc(unit, sizeof(struct wlc_pub)); pub = kzalloc(sizeof(struct wlc_pub), GFP_ATOMIC);
if (pub == NULL) { if (pub == NULL) {
*err = 1001; *err = 1001;
goto fail; goto fail;
} }
pub->tunables = wlc_calloc(unit, pub->tunables = kzalloc(sizeof(wlc_tunables_t), GFP_ATOMIC);
sizeof(wlc_tunables_t));
if (pub->tunables == NULL) { if (pub->tunables == NULL) {
*err = 1028; *err = 1028;
goto fail; goto fail;
...@@ -89,12 +80,11 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid) ...@@ -89,12 +80,11 @@ static struct wlc_pub *wlc_pub_malloc(uint unit, uint *err, uint devid)
/* need to init the tunables now */ /* need to init the tunables now */
wlc_tunables_init(pub->tunables, devid); 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) if (pub->_cnt == NULL)
goto fail; goto fail;
pub->multicast = (u8 *)wlc_calloc(unit, pub->multicast = kzalloc(ETH_ALEN * MAXMULTILIST, GFP_ATOMIC);
(ETH_ALEN * MAXMULTILIST));
if (pub->multicast == NULL) { if (pub->multicast == NULL) {
*err = 1003; *err = 1003;
goto fail; goto fail;
...@@ -122,12 +112,11 @@ static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit) ...@@ -122,12 +112,11 @@ static struct wlc_bsscfg *wlc_bsscfg_malloc(uint unit)
{ {
struct wlc_bsscfg *cfg; 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) if (cfg == NULL)
goto fail; goto fail;
cfg->current_bss = (wlc_bss_info_t *)wlc_calloc(unit, cfg->current_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
sizeof(wlc_bss_info_t));
if (cfg->current_bss == NULL) if (cfg->current_bss == NULL)
goto fail; goto fail;
...@@ -161,7 +150,7 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid) ...@@ -161,7 +150,7 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
{ {
struct wlc_info *wlc; 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) { if (wlc == NULL) {
*err = 1002; *err = 1002;
goto fail; goto fail;
...@@ -179,16 +168,15 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid) ...@@ -179,16 +168,15 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
/* allocate struct wlc_hw_info state structure */ /* allocate struct wlc_hw_info state structure */
wlc->hw = (struct wlc_hw_info *)wlc_calloc(unit, wlc->hw = kzalloc(sizeof(struct wlc_hw_info), GFP_ATOMIC);
sizeof(struct wlc_hw_info));
if (wlc->hw == NULL) { if (wlc->hw == NULL) {
*err = 1005; *err = 1005;
goto fail; goto fail;
} }
wlc->hw->wlc = wlc; wlc->hw->wlc = wlc;
wlc->hw->bandstate[0] = wlc_calloc(unit, wlc->hw->bandstate[0] =
(sizeof(struct wlc_hwband) * MAXBANDS)); kzalloc(sizeof(struct wlc_hwband) * MAXBANDS, GFP_ATOMIC);
if (wlc->hw->bandstate[0] == NULL) { if (wlc->hw->bandstate[0] == NULL) {
*err = 1006; *err = 1006;
goto fail; goto fail;
...@@ -202,15 +190,14 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid) ...@@ -202,15 +190,14 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
} }
} }
wlc->modulecb = wlc_calloc(unit, wlc->modulecb =
sizeof(struct modulecb) * WLC_MAXMODULES); kzalloc(sizeof(struct modulecb) * WLC_MAXMODULES, GFP_ATOMIC);
if (wlc->modulecb == NULL) { if (wlc->modulecb == NULL) {
*err = 1009; *err = 1009;
goto fail; goto fail;
} }
wlc->default_bss = (wlc_bss_info_t *)wlc_calloc(unit, wlc->default_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
sizeof(wlc_bss_info_t));
if (wlc->default_bss == NULL) { if (wlc->default_bss == NULL) {
*err = 1010; *err = 1010;
goto fail; goto fail;
...@@ -223,15 +210,16 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid) ...@@ -223,15 +210,16 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
} }
wlc_bsscfg_ID_assign(wlc, wlc->cfg); wlc_bsscfg_ID_assign(wlc, wlc->cfg);
wlc->pkt_callback = wlc_calloc(unit, wlc->pkt_callback = kzalloc(sizeof(struct pkt_cb) *
(sizeof(struct pkt_cb) * (wlc->pub->tunables->maxpktcb + 1))); (wlc->pub->tunables->maxpktcb + 1),
GFP_ATOMIC);
if (wlc->pkt_callback == NULL) { if (wlc->pkt_callback == NULL) {
*err = 1013; *err = 1013;
goto fail; goto fail;
} }
wlc->wsec_def_keys[0] = (wsec_key_t *)wlc_calloc(unit, wlc->wsec_def_keys[0] =
(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS)); kzalloc(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
if (wlc->wsec_def_keys[0] == NULL) { if (wlc->wsec_def_keys[0] == NULL) {
*err = 1015; *err = 1015;
goto fail; goto fail;
...@@ -244,21 +232,20 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid) ...@@ -244,21 +232,20 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
} }
} }
wlc->protection = wlc_calloc(unit, wlc->protection = kzalloc(sizeof(struct wlc_protection), GFP_ATOMIC);
sizeof(struct wlc_protection));
if (wlc->protection == NULL) { if (wlc->protection == NULL) {
*err = 1016; *err = 1016;
goto fail; goto fail;
} }
wlc->stf = wlc_calloc(unit, sizeof(struct wlc_stf)); wlc->stf = kzalloc(sizeof(struct wlc_stf), GFP_ATOMIC);
if (wlc->stf == NULL) { if (wlc->stf == NULL) {
*err = 1017; *err = 1017;
goto fail; goto fail;
} }
wlc->bandstate[0] = (struct wlcband *)wlc_calloc(unit, wlc->bandstate[0] =
(sizeof(struct wlcband)*MAXBANDS)); kzalloc(sizeof(struct wlcband)*MAXBANDS, GFP_ATOMIC);
if (wlc->bandstate[0] == NULL) { if (wlc->bandstate[0] == NULL) {
*err = 1025; *err = 1025;
goto fail; goto fail;
...@@ -272,15 +259,14 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid) ...@@ -272,15 +259,14 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
} }
} }
wlc->corestate = (struct wlccore *)wlc_calloc(unit, wlc->corestate = kzalloc(sizeof(struct wlccore), GFP_ATOMIC);
sizeof(struct wlccore));
if (wlc->corestate == NULL) { if (wlc->corestate == NULL) {
*err = 1026; *err = 1026;
goto fail; goto fail;
} }
wlc->corestate->macstat_snapshot = wlc->corestate->macstat_snapshot =
(macstat_t *)wlc_calloc(unit, sizeof(macstat_t)); kzalloc(sizeof(macstat_t), GFP_ATOMIC);
if (wlc->corestate->macstat_snapshot == NULL) { if (wlc->corestate->macstat_snapshot == NULL) {
*err = 1027; *err = 1027;
goto fail; goto fail;
......
...@@ -14,7 +14,5 @@ ...@@ -14,7 +14,5 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * 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 struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
extern void wlc_detach_mfree(struct wlc_info *wlc); extern void wlc_detach_mfree(struct wlc_info *wlc);
...@@ -8040,7 +8040,7 @@ static struct wlc_txq_info *wlc_txq_alloc(struct wlc_info *wlc) ...@@ -8040,7 +8040,7 @@ static struct wlc_txq_info *wlc_txq_alloc(struct wlc_info *wlc)
{ {
struct wlc_txq_info *qi, *p; 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) { if (qi != NULL) {
/* /*
* Have enough room for control packets along with HI watermark * Have enough room for control packets along with HI watermark
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment