mwifiex: fix checkpatch --strict warnings/errors Part 6
For file sdio.c Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Родитель
cff23cec82
Коммит
5dbd326ca7
|
@ -112,6 +112,7 @@ mwifiex_sdio_remove(struct sdio_func *func)
|
|||
{
|
||||
struct sdio_mmc_card *card;
|
||||
struct mwifiex_adapter *adapter;
|
||||
struct mwifiex_private *priv;
|
||||
int i;
|
||||
|
||||
pr_debug("info: SDIO func num=%d\n", func->num);
|
||||
|
@ -134,12 +135,9 @@ mwifiex_sdio_remove(struct sdio_func *func)
|
|||
adapter->priv[i]->media_connected)
|
||||
mwifiex_deauthenticate(adapter->priv[i], NULL);
|
||||
|
||||
mwifiex_disable_auto_ds(mwifiex_get_priv(adapter,
|
||||
MWIFIEX_BSS_ROLE_ANY));
|
||||
|
||||
mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter,
|
||||
MWIFIEX_BSS_ROLE_ANY),
|
||||
MWIFIEX_FUNC_SHUTDOWN);
|
||||
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
||||
mwifiex_disable_auto_ds(priv);
|
||||
mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
|
||||
}
|
||||
|
||||
mwifiex_remove_card(card->adapter, &add_remove_card_sem);
|
||||
|
@ -363,12 +361,11 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer,
|
|||
{
|
||||
struct sdio_mmc_card *card = adapter->card;
|
||||
int ret = -1;
|
||||
u8 blk_mode =
|
||||
(port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
|
||||
u8 blk_mode = (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE
|
||||
: BLOCK_MODE;
|
||||
u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1;
|
||||
u32 blk_cnt =
|
||||
(blk_mode ==
|
||||
BLOCK_MODE) ? (len / MWIFIEX_SDIO_BLOCK_SIZE) : len;
|
||||
u32 blk_cnt = (blk_mode == BLOCK_MODE) ? (len / MWIFIEX_SDIO_BLOCK_SIZE)
|
||||
: len;
|
||||
u32 ioport = (port & MWIFIEX_SDIO_IO_PORT_MASK);
|
||||
|
||||
if (claim)
|
||||
|
@ -472,8 +469,7 @@ static int mwifiex_write_data_to_card(struct mwifiex_adapter *adapter,
|
|||
i++;
|
||||
dev_err(adapter->dev, "host_to_card, write iomem"
|
||||
" (%d) failed: %d\n", i, ret);
|
||||
if (mwifiex_write_reg(adapter,
|
||||
CONFIGURATION_REG, 0x04))
|
||||
if (mwifiex_write_reg(adapter, CONFIGURATION_REG, 0x04))
|
||||
dev_err(adapter->dev, "write CFG reg failed\n");
|
||||
|
||||
ret = -1;
|
||||
|
@ -510,8 +506,8 @@ static int mwifiex_get_rd_port(struct mwifiex_adapter *adapter, u8 *port)
|
|||
*port, card->mp_rd_bitmap);
|
||||
} else {
|
||||
if (card->mp_rd_bitmap & (1 << card->curr_rd_port)) {
|
||||
card->mp_rd_bitmap &=
|
||||
(u16) (~(1 << card->curr_rd_port));
|
||||
card->mp_rd_bitmap &= (u16)
|
||||
(~(1 << card->curr_rd_port));
|
||||
*port = card->curr_rd_port;
|
||||
|
||||
if (++card->curr_rd_port == MAX_PORT)
|
||||
|
@ -586,8 +582,8 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
|
|||
usleep_range(10, 20);
|
||||
}
|
||||
|
||||
dev_err(adapter->dev, "poll card status failed, tries = %d\n",
|
||||
tries);
|
||||
dev_err(adapter->dev, "poll card status failed, tries = %d\n", tries);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -676,7 +672,7 @@ static int mwifiex_sdio_card_to_host(struct mwifiex_adapter *adapter,
|
|||
|
||||
nb = le16_to_cpu(*(__le16 *) (buffer));
|
||||
if (nb > npayload) {
|
||||
dev_err(adapter->dev, "%s: invalid packet, nb=%d, npayload=%d\n",
|
||||
dev_err(adapter->dev, "%s: invalid packet, nb=%d npayload=%d\n",
|
||||
__func__, nb, npayload);
|
||||
return -1;
|
||||
}
|
||||
|
@ -707,8 +703,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
u32 i = 0;
|
||||
|
||||
if (!firmware_len) {
|
||||
dev_err(adapter->dev, "firmware image not found!"
|
||||
" Terminating download\n");
|
||||
dev_err(adapter->dev,
|
||||
"firmware image not found! Terminating download\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -718,8 +714,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 firmware."
|
||||
" Terminating download\n");
|
||||
dev_err(adapter->dev,
|
||||
"unable to alloc buffer for FW. Terminating dnld\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -743,17 +739,19 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
ret = mwifiex_read_reg(adapter, HOST_F1_RD_BASE_0,
|
||||
&base0);
|
||||
if (ret) {
|
||||
dev_err(adapter->dev, "dev BASE0 register read"
|
||||
" failed: base0=0x%04X(%d). Terminating "
|
||||
"download\n", base0, base0);
|
||||
dev_err(adapter->dev,
|
||||
"dev BASE0 register read failed: "
|
||||
"base0=%#04X(%d). Terminating dnld\n",
|
||||
base0, base0);
|
||||
goto done;
|
||||
}
|
||||
ret = mwifiex_read_reg(adapter, HOST_F1_RD_BASE_1,
|
||||
&base1);
|
||||
if (ret) {
|
||||
dev_err(adapter->dev, "dev BASE1 register read"
|
||||
" failed: base1=0x%04X(%d). Terminating "
|
||||
"download\n", base1, base1);
|
||||
dev_err(adapter->dev,
|
||||
"dev BASE1 register read failed: "
|
||||
"base1=%#04X(%d). Terminating dnld\n",
|
||||
base1, base1);
|
||||
goto done;
|
||||
}
|
||||
len = (u16) (((base1 & 0xff) << 8) | (base0 & 0xff));
|
||||
|
@ -767,8 +765,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
if (!len) {
|
||||
break;
|
||||
} else if (len > MWIFIEX_UPLD_SIZE) {
|
||||
dev_err(adapter->dev, "FW download failed @ %d,"
|
||||
" invalid length %d\n", offset, len);
|
||||
dev_err(adapter->dev,
|
||||
"FW dnld failed @ %d, invalid length %d\n",
|
||||
offset, len);
|
||||
ret = -1;
|
||||
goto done;
|
||||
}
|
||||
|
@ -778,8 +777,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
if (len & BIT(0)) {
|
||||
i++;
|
||||
if (i > MAX_WRITE_IOMEM_RETRY) {
|
||||
dev_err(adapter->dev, "FW download failed @"
|
||||
" %d, over max retry count\n", offset);
|
||||
dev_err(adapter->dev,
|
||||
"FW dnld failed @ %d, over max retry\n",
|
||||
offset);
|
||||
ret = -1;
|
||||
goto done;
|
||||
}
|
||||
|
@ -796,8 +796,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
if (firmware_len - offset < txlen)
|
||||
txlen = firmware_len - offset;
|
||||
|
||||
tx_blocks = (txlen + MWIFIEX_SDIO_BLOCK_SIZE -
|
||||
1) / MWIFIEX_SDIO_BLOCK_SIZE;
|
||||
tx_blocks = (txlen + MWIFIEX_SDIO_BLOCK_SIZE - 1)
|
||||
/ MWIFIEX_SDIO_BLOCK_SIZE;
|
||||
|
||||
/* Copy payload to buffer */
|
||||
memmove(fwbuf, &firmware[offset], txlen);
|
||||
|
@ -807,8 +807,9 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
|
|||
MWIFIEX_SDIO_BLOCK_SIZE,
|
||||
adapter->ioport);
|
||||
if (ret) {
|
||||
dev_err(adapter->dev, "FW download, write iomem (%d)"
|
||||
" failed @ %d\n", i, offset);
|
||||
dev_err(adapter->dev,
|
||||
"FW download, write iomem (%d) failed @ %d\n",
|
||||
i, offset);
|
||||
if (mwifiex_write_reg(adapter, CONFIGURATION_REG, 0x04))
|
||||
dev_err(adapter->dev, "write CFG reg failed\n");
|
||||
|
||||
|
@ -955,10 +956,12 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
|
|||
|
||||
if (adapter->ps_state == PS_STATE_SLEEP_CFM)
|
||||
mwifiex_process_sleep_confirm_resp(adapter,
|
||||
skb->data, skb->len);
|
||||
skb->data,
|
||||
skb->len);
|
||||
|
||||
memcpy(cmd_buf, skb->data, min_t(u32,
|
||||
MWIFIEX_SIZE_OF_CMD_BUFFER, skb->len));
|
||||
memcpy(cmd_buf, skb->data,
|
||||
min_t(u32, MWIFIEX_SIZE_OF_CMD_BUFFER,
|
||||
skb->len));
|
||||
|
||||
dev_kfree_skb_any(skb);
|
||||
} else {
|
||||
|
@ -1239,8 +1242,8 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
|
|||
rx_blocks =
|
||||
(rx_len + MWIFIEX_SDIO_BLOCK_SIZE -
|
||||
1) / MWIFIEX_SDIO_BLOCK_SIZE;
|
||||
if (rx_len <= INTF_HEADER_LEN
|
||||
|| (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE) >
|
||||
if (rx_len <= INTF_HEADER_LEN ||
|
||||
(rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE) >
|
||||
MWIFIEX_RX_DATA_BUF_SIZE) {
|
||||
dev_err(adapter->dev, "invalid rx_len=%d\n",
|
||||
rx_len);
|
||||
|
@ -1340,8 +1343,8 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
|
|||
f_precopy_cur_buf = 1;
|
||||
|
||||
if (!(card->mp_wr_bitmap &
|
||||
(1 << card->curr_wr_port))
|
||||
|| !MP_TX_AGGR_BUF_HAS_ROOM(
|
||||
(1 << card->curr_wr_port)) ||
|
||||
!MP_TX_AGGR_BUF_HAS_ROOM(
|
||||
card, pkt_len + next_pkt_len))
|
||||
f_send_aggr_buf = 1;
|
||||
} else {
|
||||
|
@ -1356,8 +1359,8 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
|
|||
f_postcopy_cur_buf = 1;
|
||||
}
|
||||
} else {
|
||||
if (MP_TX_AGGR_BUF_HAS_ROOM(card, pkt_len)
|
||||
&& (card->mp_wr_bitmap & (1 << card->curr_wr_port)))
|
||||
if (MP_TX_AGGR_BUF_HAS_ROOM(card, pkt_len) &&
|
||||
(card->mp_wr_bitmap & (1 << card->curr_wr_port)))
|
||||
f_precopy_cur_buf = 1;
|
||||
else
|
||||
f_send_cur_buf = 1;
|
||||
|
@ -1478,7 +1481,8 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
|
|||
|
||||
if (tx_param)
|
||||
ret = mwifiex_host_to_card_mp_aggr(adapter, payload, pkt_len,
|
||||
port, tx_param->next_pkt_len);
|
||||
port, tx_param->next_pkt_len
|
||||
);
|
||||
else
|
||||
ret = mwifiex_host_to_card_mp_aggr(adapter, payload, pkt_len,
|
||||
port, 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче