Commit d4172323 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: take advantage of wfx_tx_queue_empty()



wfx_tx_queues_check_empty() can be slightly simplified by calling
wfx_tx_queue_empty().

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20210913130203.1903622-9-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14a26aa4
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -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)