aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/queue.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-04-01 13:03:42 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 08:55:34 +0200
commitf42483f9efefd9ea0ea4eb054cd1e1923626e414 (patch)
treed2ea157143622e39173fcb8de76ee763099c0c7e /drivers/staging/wfx/queue.c
parentstaging: wfx: simplify hif_handle_tx_data() (diff)
downloadlinux-dev-f42483f9efefd9ea0ea4eb054cd1e1923626e414.tar.xz
linux-dev-f42483f9efefd9ea0ea4eb054cd1e1923626e414.zip
staging: wfx: simplify wfx_tx_queues_empty()
Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the spin_lock before to check if the queue is empty. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200401110405.80282-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/queue.c')
-rw-r--r--drivers/staging/wfx/queue.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 8647731e02c0..09f823929fb6 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -303,20 +303,14 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev,
return ktime_us_delta(now, tx_priv->xmit_timestamp);
}
-bool wfx_tx_queues_is_empty(struct wfx_dev *wdev)
+bool wfx_tx_queues_empty(struct wfx_dev *wdev)
{
int i;
- struct sk_buff_head *queue;
- bool ret = true;
-
- for (i = 0; i < IEEE80211_NUM_ACS; i++) {
- queue = &wdev->tx_queue[i].queue;
- spin_lock_bh(&queue->lock);
- if (!skb_queue_empty(queue))
- ret = false;
- spin_unlock_bh(&queue->lock);
- }
- return ret;
+
+ for (i = 0; i < IEEE80211_NUM_ACS; i++)
+ if (!skb_queue_empty_lockless(&wdev->tx_queue[i].queue))
+ return false;
+ return true;
}
static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb)