From d436d0ce03a6d012da6bd95451ad20a8d8c2b79f Mon Sep 17 00:00:00 2001 From: Henry Ptasinski Date: Mon, 9 May 2011 16:32:54 +0200 Subject: [PATCH] staging: brcm80211: use common pktq_flush functions The softmac and fullmac drivers can use the same implementation of pktq_flush(), so remove the unnecessary version. Cc: devel@linuxdriverproject.org Cc: linux-wireless@vger.kernel.org Reviewed-by: Roland Vossen Reviewed-by: Brett Rudley Signed-off-by: Arend van Spriel Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2 +- drivers/staging/brcm80211/include/bcmutils.h | 13 ++------- drivers/staging/brcm80211/util/bcmutils.c | 27 ------------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index 4bfd8d867d29..c1d22c845bfc 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c @@ -2835,7 +2835,7 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex) dhdsdio_clkctl(bus, CLK_SDONLY, false); /* Clear the data packet queues */ - pktq_flush(&bus->txq, true); + pktq_flush(&bus->txq, true, NULL, 0); /* Clear any held glomming stuff */ if (bus->glomd) diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h index 0dd63a21a9f6..d83a50451878 100644 --- a/drivers/staging/brcm80211/include/bcmutils.h +++ b/drivers/staging/brcm80211/include/bcmutils.h @@ -99,13 +99,8 @@ extern struct sk_buff *pkt_buf_get_skb(uint len); extern void pkt_buf_free_skb(struct sk_buff *skb); /* Empty the queue at particular precedence level */ -#ifdef BRCM_FULLMAC - extern void pktq_pflush(struct pktq *pq, int prec, - bool dir); -#else - extern void pktq_pflush(struct pktq *pq, int prec, - bool dir, ifpkt_cb_t fn, int arg); -#endif /* BRCM_FULLMAC */ +extern void pktq_pflush(struct pktq *pq, int prec, + bool dir, ifpkt_cb_t fn, int arg); /* operations on a set of precedences in packet queue */ @@ -130,12 +125,8 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out); extern void pktq_init(struct pktq *pq, int num_prec, int max_len); /* prec_out may be NULL if caller is not interested in return value */ extern struct sk_buff *pktq_peek_tail(struct pktq *pq, int *prec_out); -#ifdef BRCM_FULLMAC - extern void pktq_flush(struct pktq *pq, bool dir); -#else extern void pktq_flush(struct pktq *pq, bool dir, ifpkt_cb_t fn, int arg); -#endif /* externs */ /* packet */ diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index 7337a75387ad..95214cf27710 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c @@ -213,32 +213,6 @@ struct sk_buff *BCMFASTPATH pktq_pdeq_tail(struct pktq *pq, int prec) return p; } -#ifdef BRCM_FULLMAC -void pktq_pflush(struct pktq *pq, int prec, bool dir) -{ - struct pktq_prec *q; - struct sk_buff *p; - - q = &pq->q[prec]; - p = q->head; - while (p) { - q->head = p->prev; - p->prev = NULL; - pkt_buf_free_skb(p); - q->len--; - pq->len--; - p = q->head; - } - q->tail = NULL; -} - -void pktq_flush(struct pktq *pq, bool dir) -{ - int prec; - for (prec = 0; prec < pq->num_prec; prec++) - pktq_pflush(pq, prec, dir); -} -#else /* !BRCM_FULLMAC */ void pktq_pflush(struct pktq *pq, int prec, bool dir, ifpkt_cb_t fn, int arg) @@ -278,7 +252,6 @@ void pktq_flush(struct pktq *pq, bool dir, for (prec = 0; prec < pq->num_prec; prec++) pktq_pflush(pq, prec, dir, fn, arg); } -#endif /* BRCM_FULLMAC */ void pktq_init(struct pktq *pq, int num_prec, int max_len) { -- 2.39.5