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>
This commit is contained in:
		
					parent
					
						
							
								d53c74e5a1
							
						
					
				
			
			
				commit
				
					
						6a01f0c08d
					
				
			
		
					 1 changed files with 2 additions and 7 deletions
				
			
		| 
						 | 
					@ -169,22 +169,17 @@ static void ath_rx_addbuffer_edma(struct ath_softc *sc,
 | 
				
			||||||
				  enum ath9k_rx_qtype qtype, int size)
 | 
									  enum ath9k_rx_qtype qtype, int size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 | 
						struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 | 
				
			||||||
	u32 nbuf = 0;
 | 
						struct ath_buf *bf, *tbf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (list_empty(&sc->rx.rxbuf)) {
 | 
						if (list_empty(&sc->rx.rxbuf)) {
 | 
				
			||||||
		ath_dbg(common, QUEUE, "No free rx buf available\n");
 | 
							ath_dbg(common, QUEUE, "No free rx buf available\n");
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (!list_empty(&sc->rx.rxbuf)) {
 | 
						list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list)
 | 
				
			||||||
		nbuf++;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (!ath_rx_edma_buf_link(sc, qtype))
 | 
							if (!ath_rx_edma_buf_link(sc, qtype))
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (nbuf >= size)
 | 
					 | 
				
			||||||
			break;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void ath_rx_remove_buffer(struct ath_softc *sc,
 | 
					static void ath_rx_remove_buffer(struct ath_softc *sc,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue