The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6977311633c73f594ff3dae150d6d1fe06105a8f

commit 6977311633c73f594ff3dae150d6d1fe06105a8f
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2024-01-09 18:59:48 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2024-01-09 18:59:48 +0000

    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
---
 sys/net80211/ieee80211_ht.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index ea59bb622dd8..5297b741d9b9 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -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;
@@ -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;

Reply via email to