From d4172323526ae0b6097dd944dbe56739a4cba129 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Mon, 13 Sep 2021 15:01:39 +0200 Subject: [PATCH] staging: wfx: take advantage of wfx_tx_queue_empty() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit wfx_tx_queues_check_empty() can be slightly simplified by calling wfx_tx_queue_empty(). Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20210913130203.1903622-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wfx/queue.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index fa272c120f1cb..0ab207237d9f4 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -73,23 +73,22 @@ void wfx_tx_queues_init(struct wfx_vif *wvif) } } +bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue) +{ + return skb_queue_empty_lockless(&queue->normal) && + skb_queue_empty_lockless(&queue->cab); +} + void wfx_tx_queues_check_empty(struct wfx_vif *wvif) { int i; for (i = 0; i < IEEE80211_NUM_ACS; ++i) { WARN_ON(atomic_read(&wvif->tx_queue[i].pending_frames)); - WARN_ON(!skb_queue_empty_lockless(&wvif->tx_queue[i].normal)); - WARN_ON(!skb_queue_empty_lockless(&wvif->tx_queue[i].cab)); + WARN_ON(!wfx_tx_queue_empty(wvif, &wvif->tx_queue[i])); } } -bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue) -{ - return skb_queue_empty_lockless(&queue->normal) && - skb_queue_empty_lockless(&queue->cab); -} - static void __wfx_tx_queue_drop(struct wfx_vif *wvif, struct sk_buff_head *skb_queue, struct sk_buff_head *dropped) -- 2.30.2