ath9k: Remove the useless do..while loops
PATCH 12/17 ath9k: Remove the useless do..while loops
These are unnecessary constructs in a function.
This patch removes these from both RX and TX init
routines.
Signed-off-by Sujith <[email protected]>
--- drivers/net/wireless/ath9k/ath9k.h | 2 +- drivers/net/wireless/ath9k/recv.c | 83 +++++++++++++++++------------------- drivers/net/wireless/ath9k/xmit.c | 40 +++++++---------- 3 files changed, 57 insertions(+), 68 deletions(-)
drivers/net/wireless/ath9k/ath9k.h +1 -1
@@ -344,7 +344,7 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an);void ath_tx_node_cleanup (struct ath_softc *sc,struct ath_node *an);void ath_txq_schedule (struct ath_softc *sc,struct ath_txq *txq);int ath_tx_init (struct ath_softc *sc,int nbufs); -int ath_tx_cleanup (struct ath_softc *sc); +void ath_tx_cleanup (struct ath_softc *sc);struct ath_txq *ath_test_get_txq (struct ath_softc *sc,struct sk_buff *skb);int ath_txq_update (struct ath_softc *sc,int qnum,struct ath9k_tx_queue_info *q);
drivers/net/wireless/ath9k/recv.c +39 -44
103 lines not on this page · raw message
drivers/net/wireless/ath9k/xmit.c +17 -23
@@ -2047,44 +2047,38 @@ int ath_tx_init(struct ath_softc *sc, int nbufs) {int error =0 ; -do { -spin_lock_init (&sc->tx.txbuflock); +spin_lock_init (&sc->tx.txbuflock); - error =ath_descdma_setup (sc, &sc->tx.txdma, &sc->tx.txbuf, -"tx" , nbufs,1 ); -if (error !=0 ) { -DPRINTF (sc,ATH_DBG_FATAL , -"Failed to allocate tx descriptors: %d\n" , - error); -break ; - } - - error =ath_descdma_setup (sc, &sc->beacon.bdma, &sc->beacon.bbuf, -"beacon" ,ATH_BCBUF ,1 ); -if (error !=0 ) { -DPRINTF (sc,ATH_DBG_FATAL , -"Failed to allocate beacon descriptors: %d\n" , - error); -break ; - } + error =ath_descdma_setup (sc, &sc->tx.txdma, &sc->tx.txbuf, +"tx" , nbufs,1 ); +if (error !=0 ) { +DPRINTF (sc,ATH_DBG_FATAL , +"Failed to allocate tx descriptors: %d\n" , error); + goto err; + } - }while (0 ); + error =ath_descdma_setup (sc, &sc->beacon.bdma, &sc->beacon.bbuf, +"beacon" ,ATH_BCBUF ,1 ); +if (error !=0 ) { +DPRINTF (sc,ATH_DBG_FATAL , +"Failed to allocate beacon descriptors: %d\n" , error); + goto err; + } +err:if (error !=0 )ath_tx_cleanup (sc);return error; } -int ath_tx_cleanup (struct ath_softc *sc) +void ath_tx_cleanup (struct ath_softc *sc) {if (sc->beacon.bdma.dd_desc_len !=0 )ath_descdma_cleanup (sc, &sc->beacon.bdma, &sc->beacon.bbuf);if (sc->tx.txdma.dd_desc_len !=0 )ath_descdma_cleanup (sc, &sc->tx.txdma, &sc->tx.txbuf); - -return 0 ; }void ath_tx_node_init (struct ath_softc *sc,struct ath_node *an)
Signature · 1 line
1.6.2.1