mirror of https://gitee.com/openkylin/linux.git
mwifiex: kill useless list_empty checks
There's absolutely no reason to check to see if a list is empty before iterating through it. It's just like writing code like this: if (count != 0) { for (i = 0; i < count; i++) { ... } } The loop will already be avoided if "count == 0" so there was no reason to check. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
0f0a0af826
commit
40351051d0
|
@ -658,12 +658,6 @@ void mwifiex_11n_delba(struct mwifiex_private *priv, int tid)
|
|||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&priv->rx_reorder_tbl_lock, flags);
|
||||
if (list_empty(&priv->rx_reorder_tbl_ptr)) {
|
||||
dev_dbg(priv->adapter->dev,
|
||||
"mwifiex_11n_delba: rx_reorder_tbl_ptr empty\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
list_for_each_entry(rx_reor_tbl_ptr, &priv->rx_reorder_tbl_ptr, list) {
|
||||
if (rx_reor_tbl_ptr->tid == tid) {
|
||||
dev_dbg(priv->adapter->dev,
|
||||
|
@ -854,9 +848,6 @@ mwifiex_send_delba_txbastream_tbl(struct mwifiex_private *priv, u8 tid)
|
|||
struct mwifiex_adapter *adapter = priv->adapter;
|
||||
struct mwifiex_tx_ba_stream_tbl *tx_ba_stream_tbl_ptr;
|
||||
|
||||
if (list_empty(&priv->tx_ba_stream_tbl_ptr))
|
||||
return;
|
||||
|
||||
list_for_each_entry(tx_ba_stream_tbl_ptr,
|
||||
&priv->tx_ba_stream_tbl_ptr, list) {
|
||||
if (tx_ba_stream_tbl_ptr->ba_status == BA_SETUP_COMPLETE) {
|
||||
|
|
|
@ -835,12 +835,6 @@ void mwifiex_update_rxreor_flags(struct mwifiex_adapter *adapter, u8 flags)
|
|||
continue;
|
||||
|
||||
spin_lock_irqsave(&priv->rx_reorder_tbl_lock, lock_flags);
|
||||
if (list_empty(&priv->rx_reorder_tbl_ptr)) {
|
||||
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock,
|
||||
lock_flags);
|
||||
continue;
|
||||
}
|
||||
|
||||
list_for_each_entry(tbl, &priv->rx_reorder_tbl_ptr, list)
|
||||
tbl->flags = flags;
|
||||
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, lock_flags);
|
||||
|
|
|
@ -579,10 +579,6 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
|
|||
|
||||
{
|
||||
spin_lock_irqsave(lock, flags);
|
||||
if (list_empty(head)) {
|
||||
spin_unlock_irqrestore(lock, flags);
|
||||
continue;
|
||||
}
|
||||
list_for_each_entry_safe(bssprio_node, tmp_node, head,
|
||||
list) {
|
||||
if (bssprio_node->priv == priv) {
|
||||
|
|
|
@ -1413,13 +1413,6 @@ void mwifiex_check_auto_tdls(unsigned long context)
|
|||
|
||||
priv->check_tdls_tx = false;
|
||||
|
||||
if (list_empty(&priv->auto_tdls_list)) {
|
||||
mod_timer(&priv->auto_tdls_timer,
|
||||
jiffies +
|
||||
msecs_to_jiffies(MWIFIEX_TIMER_10S));
|
||||
return;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&priv->auto_tdls_lock, flags);
|
||||
list_for_each_entry(tdls_peer, &priv->auto_tdls_list, list) {
|
||||
if ((jiffies - tdls_peer->rssi_jiffies) >
|
||||
|
|
Loading…
Reference in New Issue