Commit 89125618 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: remove unnecessary while(0) in wilc_wlan_handle_txq()

Refactor wilc_wlan_handle_txq() by removing unnecessary while(0)
loop. "Line over 80 char" issues in wilc_wlan_handle_txq() are fix by
reducing extra leading tab.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c8d4e2e1
...@@ -583,9 +583,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -583,9 +583,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
txb = wilc->tx_buffer; txb = wilc->tx_buffer;
wilc->txq_exit = 0; wilc->txq_exit = 0;
do {
if (wilc->quit) if (wilc->quit)
break; goto out;
mutex_lock(&wilc->txq_add_to_head_cs); mutex_lock(&wilc->txq_add_to_head_cs);
wilc_wlan_txq_filter_dup_tcp_ack(dev); wilc_wlan_txq_filter_dup_tcp_ack(dev);
...@@ -625,7 +625,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -625,7 +625,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
} while (1); } while (1);
if (i == 0) if (i == 0)
break; goto out;
vmm_table[i] = 0x0; vmm_table[i] = 0x0;
acquire_bus(wilc, ACQUIRE_AND_WAKEUP); acquire_bus(wilc, ACQUIRE_AND_WAKEUP);
...@@ -642,8 +642,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -642,8 +642,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
counter++; counter++;
if (counter > 200) { if (counter > 200) {
counter = 0; counter = 0;
ret = func->hif_write_reg(wilc, ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0);
WILC_HOST_TX_CTRL, 0);
break; break;
} }
} while (!wilc->quit); } while (!wilc->quit);
...@@ -665,9 +664,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -665,9 +664,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
break; break;
do { do {
ret = func->hif_read_reg(wilc, ret = func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, &reg);
WILC_HOST_VMM_CTL,
&reg);
if (!ret) if (!ret)
break; break;
if ((reg >> 2) & 0x1) { if ((reg >> 2) & 0x1) {
...@@ -677,9 +674,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -677,9 +674,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
release_bus(wilc, RELEASE_ALLOW_SLEEP); release_bus(wilc, RELEASE_ALLOW_SLEEP);
} while (--timeout); } while (--timeout);
if (timeout <= 0) { if (timeout <= 0) {
ret = func->hif_write_reg(wilc, ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0);
WILC_HOST_VMM_CTL,
0x0);
break; break;
} }
...@@ -687,15 +682,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -687,15 +682,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
break; break;
if (entries == 0) { if (entries == 0) {
ret = func->hif_read_reg(wilc, ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg);
WILC_HOST_TX_CTRL,
&reg);
if (!ret) if (!ret)
break; break;
reg &= ~BIT(0); reg &= ~BIT(0);
ret = func->hif_write_reg(wilc, ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg);
WILC_HOST_TX_CTRL,
reg);
if (!ret) if (!ret)
break; break;
break; break;
...@@ -768,15 +759,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ...@@ -768,15 +759,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
goto _end_; goto _end_;
ret = func->hif_block_tx_ext(wilc, 0, txb, offset); ret = func->hif_block_tx_ext(wilc, 0, txb, offset);
if (!ret)
goto _end_;
_end_: _end_:
release_bus(wilc, RELEASE_ALLOW_SLEEP); release_bus(wilc, RELEASE_ALLOW_SLEEP);
if (ret != 1)
break; out:
} while (0);
mutex_unlock(&wilc->txq_add_to_head_cs); mutex_unlock(&wilc->txq_add_to_head_cs);
wilc->txq_exit = 1; wilc->txq_exit = 1;
......
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