rsi: Clean up loop in the interrupt handler
The inner do { ... } while loop is completely useless, all it does is iterate over a switch-case statement, one bit at a time. This can easily be replaced by simple if (status & bit) { ... } tests for each bit. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Angus Ainslie <angus@akkea.ca> Cc: David S. Miller <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: Lee Jones <lee.jones@linaro.org> Cc: Martin Kepplinger <martink@posteo.de> Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Cc: Siva Rebbagondla <siva8118@gmail.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20201103180941.443528-2-marex@denx.de
This commit is contained in:
parent
287431463e
commit
abd131a19f
@ -236,7 +236,6 @@ static void rsi_rx_handler(struct rsi_hw *adapter)
|
|||||||
struct rsi_91x_sdiodev *dev =
|
struct rsi_91x_sdiodev *dev =
|
||||||
(struct rsi_91x_sdiodev *)adapter->rsi_dev;
|
(struct rsi_91x_sdiodev *)adapter->rsi_dev;
|
||||||
int status;
|
int status;
|
||||||
enum sdio_interrupt_type isr_type;
|
|
||||||
u8 isr_status = 0;
|
u8 isr_status = 0;
|
||||||
u8 fw_status = 0;
|
u8 fw_status = 0;
|
||||||
|
|
||||||
@ -267,30 +266,25 @@ static void rsi_rx_handler(struct rsi_hw *adapter)
|
|||||||
__func__, isr_status, (1 << MSDU_PKT_PENDING),
|
__func__, isr_status, (1 << MSDU_PKT_PENDING),
|
||||||
(1 << FW_ASSERT_IND));
|
(1 << FW_ASSERT_IND));
|
||||||
|
|
||||||
do {
|
if (isr_status & BIT(PKT_BUFF_AVAILABLE)) {
|
||||||
RSI_GET_SDIO_INTERRUPT_TYPE(isr_status, isr_type);
|
status = rsi_sdio_check_buffer_status(adapter, 0);
|
||||||
|
|
||||||
switch (isr_type) {
|
|
||||||
case BUFFER_AVAILABLE:
|
|
||||||
status = rsi_sdio_check_buffer_status(adapter,
|
|
||||||
0);
|
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
rsi_dbg(ERR_ZONE,
|
rsi_dbg(ERR_ZONE,
|
||||||
"%s: Failed to check buffer status\n",
|
"%s: Failed to check buffer status\n",
|
||||||
__func__);
|
__func__);
|
||||||
rsi_sdio_ack_intr(common->priv,
|
rsi_sdio_ack_intr(common->priv,
|
||||||
(1 << PKT_BUFF_AVAILABLE));
|
BIT(PKT_BUFF_AVAILABLE));
|
||||||
rsi_set_event(&common->tx_thread.event);
|
rsi_set_event(&common->tx_thread.event);
|
||||||
|
|
||||||
rsi_dbg(ISR_ZONE,
|
rsi_dbg(ISR_ZONE, "%s: ==> BUFFER_AVAILABLE <==\n",
|
||||||
"%s: ==> BUFFER_AVAILABLE <==\n",
|
|
||||||
__func__);
|
__func__);
|
||||||
dev->buff_status_updated = true;
|
dev->buff_status_updated = true;
|
||||||
break;
|
|
||||||
|
|
||||||
case FIRMWARE_ASSERT_IND:
|
isr_status &= ~BIT(PKT_BUFF_AVAILABLE);
|
||||||
rsi_dbg(ERR_ZONE,
|
}
|
||||||
"%s: ==> FIRMWARE Assert <==\n",
|
|
||||||
|
if (isr_status & BIT(FW_ASSERT_IND)) {
|
||||||
|
rsi_dbg(ERR_ZONE, "%s: ==> FIRMWARE Assert <==\n",
|
||||||
__func__);
|
__func__);
|
||||||
status = rsi_sdio_read_register(common->priv,
|
status = rsi_sdio_read_register(common->priv,
|
||||||
SDIO_FW_STATUS_REG,
|
SDIO_FW_STATUS_REG,
|
||||||
@ -302,38 +296,39 @@ static void rsi_rx_handler(struct rsi_hw *adapter)
|
|||||||
} else {
|
} else {
|
||||||
rsi_dbg(ERR_ZONE,
|
rsi_dbg(ERR_ZONE,
|
||||||
"%s: Firmware Status is 0x%x\n",
|
"%s: Firmware Status is 0x%x\n",
|
||||||
__func__ , fw_status);
|
__func__, fw_status);
|
||||||
rsi_sdio_ack_intr(common->priv,
|
rsi_sdio_ack_intr(common->priv,
|
||||||
(1 << FW_ASSERT_IND));
|
BIT(FW_ASSERT_IND));
|
||||||
}
|
}
|
||||||
|
|
||||||
common->fsm_state = FSM_CARD_NOT_READY;
|
common->fsm_state = FSM_CARD_NOT_READY;
|
||||||
break;
|
|
||||||
|
|
||||||
case MSDU_PACKET_PENDING:
|
isr_status &= ~BIT(FW_ASSERT_IND);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isr_status & BIT(MSDU_PKT_PENDING)) {
|
||||||
rsi_dbg(ISR_ZONE, "Pkt pending interrupt\n");
|
rsi_dbg(ISR_ZONE, "Pkt pending interrupt\n");
|
||||||
dev->rx_info.total_sdio_msdu_pending_intr++;
|
dev->rx_info.total_sdio_msdu_pending_intr++;
|
||||||
|
|
||||||
status = rsi_process_pkt(common);
|
status = rsi_process_pkt(common);
|
||||||
if (status) {
|
if (status) {
|
||||||
rsi_dbg(ERR_ZONE,
|
rsi_dbg(ERR_ZONE, "%s: Failed to read pkt\n",
|
||||||
"%s: Failed to read pkt\n",
|
|
||||||
__func__);
|
__func__);
|
||||||
mutex_unlock(&common->rx_lock);
|
mutex_unlock(&common->rx_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
isr_status &= ~BIT(MSDU_PKT_PENDING);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isr_status) {
|
||||||
rsi_sdio_ack_intr(common->priv, isr_status);
|
rsi_sdio_ack_intr(common->priv, isr_status);
|
||||||
dev->rx_info.total_sdio_unknown_intr++;
|
dev->rx_info.total_sdio_unknown_intr++;
|
||||||
isr_status = 0;
|
isr_status = 0;
|
||||||
rsi_dbg(ISR_ZONE,
|
rsi_dbg(ISR_ZONE, "Unknown Interrupt %x\n",
|
||||||
"Unknown Interrupt %x\n",
|
|
||||||
isr_status);
|
isr_status);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
isr_status ^= BIT(isr_type - 1);
|
|
||||||
} while (isr_status);
|
|
||||||
mutex_unlock(&common->rx_lock);
|
mutex_unlock(&common->rx_lock);
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user