OSDN Git Service

wifi: brcmutil: use helper function pktq_empty() instead of open code
authorJuhee Kang <claudiajkang@gmail.com>
Sat, 27 May 2023 11:49:54 +0000 (20:49 +0900)
committerKalle Valo <kvalo@kernel.org>
Thu, 1 Jun 2023 13:14:43 +0000 (16:14 +0300)
pktq_empty was added in commit 5b435de0d786 ("net: wireless: add brcm80211
drivers") but it is currently not being utilized in some areas. This commit
replaces the open code with the pktq_empty() function.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230527114954.3281-2-claudiajkang@gmail.com
drivers/net/wireless/broadcom/brcm80211/brcmutil/utils.c

index e87e68c..fe94db0 100644 (file)
@@ -186,7 +186,7 @@ struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out)
 {
        int prec;
 
-       if (pq->len == 0)
+       if (pktq_empty(pq))
                return NULL;
 
        for (prec = 0; prec < pq->hi_prec; prec++)
@@ -223,7 +223,7 @@ struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp,
        struct sk_buff *p;
        int prec;
 
-       if (pq->len == 0)
+       if (pktq_empty(pq))
                return NULL;
 
        while ((prec = pq->hi_prec) > 0 &&