Skip to content

Commit

Permalink
net80211 amdpu: Simplify a few loops that drain an mbufq
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bsdjhb committed Mar 14, 2024
2 parents 891b896 + 6977311 commit cb3b355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/net80211/ieee80211_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,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;
Expand Down Expand Up @@ -812,7 +812,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;
Expand Down

0 comments on commit cb3b355

Please sign in to comment.