From eb36bedf28be6d986bdbcfa375bab08ffa45efd8 Mon Sep 17 00:00:00 2001 From: Lino Sanfilippo Date: Sat, 18 Feb 2017 12:27:12 +0100 Subject: net: aquantia: remove function aq_ring_tx_deinit Both functions aq_ring_rx_deinit() and aq_ring_tx_clean() are almost identical aside from an additional check in the latter. Move that check from the function into its caller and replace aq_ring_rx_deinit() with aq_ring_rx_deinit(). By doing this also adjust the functions return value from int to void since it can never fail. Signed-off-by: Lino Sanfilippo Tested-by: Pavel Belous Signed-off-by: David S. Miller --- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'drivers/net/ethernet/aquantia/atlantic/aq_vec.c') diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c index cb30a6396a70..ad5b4d4dac7f 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c @@ -59,10 +59,14 @@ __acquires(&self->lock) } if (ring[AQ_VEC_TX_ID].sw_head != - ring[AQ_VEC_TX_ID].hw_head) { - err = aq_ring_tx_clean(&ring[AQ_VEC_TX_ID]); - if (err < 0) - goto err_exit; + ring[AQ_VEC_TX_ID].hw_head) { + aq_ring_tx_clean(&ring[AQ_VEC_TX_ID]); + + if (aq_ring_avail_dx(&ring[AQ_VEC_TX_ID]) > + AQ_CFG_SKB_FRAGS_MAX) { + aq_nic_ndev_queue_start(self->aq_nic, + ring[AQ_VEC_TX_ID].idx); + } was_tx_cleaned = true; } @@ -271,7 +275,7 @@ void aq_vec_deinit(struct aq_vec_s *self) for (i = 0U, ring = self->ring[0]; self->tx_rings > i; ++i, ring = self->ring[i]) { - aq_ring_tx_deinit(&ring[AQ_VEC_TX_ID]); + aq_ring_tx_clean(&ring[AQ_VEC_TX_ID]); aq_ring_rx_deinit(&ring[AQ_VEC_RX_ID]); } err_exit:; -- cgit v1.2.3