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>
This commit is contained in:
parent
9d11bd1592
commit
0d2e7a5c60
22 changed files with 50 additions and 133 deletions
|
@ -718,11 +718,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
|
||||
/* Assume that the allocated buffer is 8-byte aligned */
|
||||
fwbuf = kzalloc(MWIFIEX_UPLD_SIZE, GFP_KERNEL);
|
||||
if (!fwbuf) {
|
||||
dev_err(adapter->dev,
|
||||
"unable to alloc buffer for FW. Terminating dnld\n");
|
||||
if (!fwbuf)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Perform firmware data transfer */
|
||||
do {
|
||||
|
@ -1520,7 +1517,6 @@ static int mwifiex_alloc_sdio_mpa_buffers(struct mwifiex_adapter *adapter,
|
|||
|
||||
card->mpa_tx.buf = kzalloc(mpa_tx_buf_size, GFP_KERNEL);
|
||||
if (!card->mpa_tx.buf) {
|
||||
dev_err(adapter->dev, "could not alloc buffer for MP-A TX\n");
|
||||
ret = -1;
|
||||
goto error;
|
||||
}
|
||||
|
@ -1529,7 +1525,6 @@ static int mwifiex_alloc_sdio_mpa_buffers(struct mwifiex_adapter *adapter,
|
|||
|
||||
card->mpa_rx.buf = kzalloc(mpa_rx_buf_size, GFP_KERNEL);
|
||||
if (!card->mpa_rx.buf) {
|
||||
dev_err(adapter->dev, "could not alloc buffer for MP-A RX\n");
|
||||
ret = -1;
|
||||
goto error;
|
||||
}
|
||||
|
@ -1682,10 +1677,8 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
|
|||
|
||||
/* Allocate buffers for SDIO MP-A */
|
||||
card->mp_regs = kzalloc(MAX_MP_REGS, GFP_KERNEL);
|
||||
if (!card->mp_regs) {
|
||||
dev_err(adapter->dev, "failed to alloc mp_regs\n");
|
||||
if (!card->mp_regs)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ret = mwifiex_alloc_sdio_mpa_buffers(adapter,
|
||||
SDIO_MP_TX_AGGR_DEF_BUF_SIZE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue