diff options
author | Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> | 2012-02-28 10:24:44 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-05 15:23:14 -0500 |
commit | 6a01f0c08d20a2b1356c1cb90ef97a0dc412b64c (patch) | |
tree | 0ece06da5387450b45fc78eea54c127ba7793c37 /drivers/net/wireless/ath/ath9k | |
parent | d53c74e5a124b0aaed7e9b5c462d1806aad54757 (diff) |
ath9k: make use of list_for_each_entry_safe
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>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 7e1a91af149..4633f513a80 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -169,22 +169,17 @@ static void ath_rx_addbuffer_edma(struct ath_softc *sc, | |||
169 | enum ath9k_rx_qtype qtype, int size) | 169 | enum ath9k_rx_qtype qtype, int size) |
170 | { | 170 | { |
171 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 171 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
172 | u32 nbuf = 0; | 172 | struct ath_buf *bf, *tbf; |
173 | 173 | ||
174 | if (list_empty(&sc->rx.rxbuf)) { | 174 | if (list_empty(&sc->rx.rxbuf)) { |
175 | ath_dbg(common, QUEUE, "No free rx buf available\n"); | 175 | ath_dbg(common, QUEUE, "No free rx buf available\n"); |
176 | return; | 176 | return; |
177 | } | 177 | } |
178 | 178 | ||
179 | while (!list_empty(&sc->rx.rxbuf)) { | 179 | list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) |
180 | nbuf++; | ||
181 | |||
182 | if (!ath_rx_edma_buf_link(sc, qtype)) | 180 | if (!ath_rx_edma_buf_link(sc, qtype)) |
183 | break; | 181 | break; |
184 | 182 | ||
185 | if (nbuf >= size) | ||
186 | break; | ||
187 | } | ||
188 | } | 183 | } |
189 | 184 | ||
190 | static void ath_rx_remove_buffer(struct ath_softc *sc, | 185 | static void ath_rx_remove_buffer(struct ath_softc *sc, |