net80211 amdpu: Simplify a few loops that drain an mbufq

These loops already handled a NULL return from mbufq_dequeue when the
queue was empty, so remove a redundant check of mbufq_len before
dequeueing.

Reviewed by:	bz
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43336

(cherry picked from commit 6977311633)
This commit is contained in:
John Baldwin 2024-01-09 10:59:48 -08:00
parent e000bd2551
commit 2bc7fdc3a8

View file

@ -521,7 +521,7 @@ ampdu_rx_purge_slot(struct ieee80211_rx_ampdu *rap, int i)
struct mbuf *m;
/* Walk the queue, removing frames as appropriate */
while (mbufq_len(&rap->rxa_mq[i]) != 0) {
for (;;) {
m = mbufq_dequeue(&rap->rxa_mq[i]);
if (m == NULL)
break;
@ -816,7 +816,7 @@ ampdu_dispatch_slot(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni,
struct mbuf *m;
int n = 0;
while (mbufq_len(&rap->rxa_mq[i]) != 0) {
for (;;) {
m = mbufq_dequeue(&rap->rxa_mq[i]);
if (m == NULL)
break;