]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ath9k: make use of list_for_each_entry_safe
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tue, 28 Feb 2012 15:24:44 +0000 (20:54 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 5 Mar 2012 20:23:14 +0000 (15:23 -0500)
this does the same thing as the previous code

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/recv.c

index 7e1a91af149751b13a53ee9d6dab5c16fcd2f01f..4633f513a80b8da6e393c5b14ddf3c09560855df 100644 (file)
@@ -169,22 +169,17 @@ static void ath_rx_addbuffer_edma(struct ath_softc *sc,
                                  enum ath9k_rx_qtype qtype, int size)
 {
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-       u32 nbuf = 0;
+       struct ath_buf *bf, *tbf;
 
        if (list_empty(&sc->rx.rxbuf)) {
                ath_dbg(common, QUEUE, "No free rx buf available\n");
                return;
        }
 
-       while (!list_empty(&sc->rx.rxbuf)) {
-               nbuf++;
-
+       list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list)
                if (!ath_rx_edma_buf_link(sc, qtype))
                        break;
 
-               if (nbuf >= size)
-                       break;
-       }
 }
 
 static void ath_rx_remove_buffer(struct ath_softc *sc,