aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-01-09 18:59:48 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-01-18 22:37:03 +0000
commit2bc7fdc3a8d0d9b86c219714d93145eececfa622 (patch)
tree9d9744256f77302ee8efd1051fefa616c9574065
parente000bd2551a34ae1513e90ebf258f523048584d1 (diff)
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 6977311633c73f594ff3dae150d6d1fe06105a8f)
-rw-r--r--sys/net80211/ieee80211_ht.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 61c57b87c5d7..a322c21b4673 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -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;