aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sdio.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-02-03 12:28:14 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-04 13:22:34 -0500
commit0d2e7a5c608063f72048899d20505c2ee130566c (patch)
tree4eae4acaf7c04bb60337389aaef8065c00b1737a /drivers/net/wireless/mwifiex/sdio.c
parent9d11bd1592fba0b9231d3ce8ab61977db7e03e27 (diff)
wireless: Remove unnecessary alloc/OOM messages, alloc cleanups
alloc failures already get standardized OOM messages and a dump_stack. Convert kzalloc's with multiplies to kcalloc. Convert kmalloc's with multiplies to kmalloc_array. Remove now unused variables. Remove unnecessary memset after kzalloc->kcalloc. Whitespace cleanups for these changes. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sdio.c')
-rw-r--r--drivers/net/wireless/mwifiex/sdio.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 5a1c1d0e5599..31d7b2bdaa31 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -718,11 +718,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
718 718
719 /* Assume that the allocated buffer is 8-byte aligned */ 719 /* Assume that the allocated buffer is 8-byte aligned */
720 fwbuf = kzalloc(MWIFIEX_UPLD_SIZE, GFP_KERNEL); 720 fwbuf = kzalloc(MWIFIEX_UPLD_SIZE, GFP_KERNEL);
721 if (!fwbuf) { 721 if (!fwbuf)
722 dev_err(adapter->dev,
723 "unable to alloc buffer for FW. Terminating dnld\n");
724 return -ENOMEM; 722 return -ENOMEM;
725 }
726 723
727 /* Perform firmware data transfer */ 724 /* Perform firmware data transfer */
728 do { 725 do {
@@ -1520,7 +1517,6 @@ static int mwifiex_alloc_sdio_mpa_buffers(struct mwifiex_adapter *adapter,
1520 1517
1521 card->mpa_tx.buf = kzalloc(mpa_tx_buf_size, GFP_KERNEL); 1518 card->mpa_tx.buf = kzalloc(mpa_tx_buf_size, GFP_KERNEL);
1522 if (!card->mpa_tx.buf) { 1519 if (!card->mpa_tx.buf) {
1523 dev_err(adapter->dev, "could not alloc buffer for MP-A TX\n");
1524 ret = -1; 1520 ret = -1;
1525 goto error; 1521 goto error;
1526 } 1522 }
@@ -1529,7 +1525,6 @@ static int mwifiex_alloc_sdio_mpa_buffers(struct mwifiex_adapter *adapter,
1529 1525
1530 card->mpa_rx.buf = kzalloc(mpa_rx_buf_size, GFP_KERNEL); 1526 card->mpa_rx.buf = kzalloc(mpa_rx_buf_size, GFP_KERNEL);
1531 if (!card->mpa_rx.buf) { 1527 if (!card->mpa_rx.buf) {
1532 dev_err(adapter->dev, "could not alloc buffer for MP-A RX\n");
1533 ret = -1; 1528 ret = -1;
1534 goto error; 1529 goto error;
1535 } 1530 }
@@ -1682,10 +1677,8 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
1682 1677
1683 /* Allocate buffers for SDIO MP-A */ 1678 /* Allocate buffers for SDIO MP-A */
1684 card->mp_regs = kzalloc(MAX_MP_REGS, GFP_KERNEL); 1679 card->mp_regs = kzalloc(MAX_MP_REGS, GFP_KERNEL);
1685 if (!card->mp_regs) { 1680 if (!card->mp_regs)
1686 dev_err(adapter->dev, "failed to alloc mp_regs\n");
1687 return -ENOMEM; 1681 return -ENOMEM;
1688 }
1689 1682
1690 ret = mwifiex_alloc_sdio_mpa_buffers(adapter, 1683 ret = mwifiex_alloc_sdio_mpa_buffers(adapter,
1691 SDIO_MP_TX_AGGR_DEF_BUF_SIZE, 1684 SDIO_MP_TX_AGGR_DEF_BUF_SIZE,