diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2017-02-18 14:27:12 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-20 18:23:41 +0300 |
commit | eb36bedf28be6d986bdbcfa375bab08ffa45efd8 (patch) | |
tree | 3c9a78e2246bea7e0e242e2d57bf9127c8b3d208 /drivers/net/ethernet/aquantia/atlantic/aq_ring.c | |
parent | 90a6c997bd8bb836809eda5efb6406d8c58c0924 (diff) | |
download | linux-eb36bedf28be6d986bdbcfa375bab08ffa45efd8.tar.xz |
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 <LinoSanfilippo@gmx.de>
Tested-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aquantia/atlantic/aq_ring.c')
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index dea9e9bbb8e7..fed6ac51559f 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -123,7 +123,7 @@ void aq_ring_tx_append_buffs(struct aq_ring_s *self, } } -int aq_ring_tx_clean(struct aq_ring_s *self) +void aq_ring_tx_clean(struct aq_ring_s *self) { struct device *dev = aq_nic_get_dev(self->aq_nic); @@ -143,11 +143,6 @@ int aq_ring_tx_clean(struct aq_ring_s *self) if (unlikely(buff->is_eop)) dev_kfree_skb_any(buff->skb); } - - if (aq_ring_avail_dx(self) > AQ_CFG_SKB_FRAGS_MAX) - aq_nic_ndev_queue_start(self->aq_nic, self->idx); - - return 0; } static inline unsigned int aq_ring_dx_in_range(unsigned int h, unsigned int i, @@ -333,32 +328,6 @@ void aq_ring_rx_deinit(struct aq_ring_s *self) err_exit:; } -void aq_ring_tx_deinit(struct aq_ring_s *self) -{ - if (!self) - goto err_exit; - - for (; self->sw_head != self->sw_tail; - self->sw_head = aq_ring_next_dx(self, self->sw_head)) { - struct aq_ring_buff_s *buff = &self->buff_ring[self->sw_head]; - struct device *ndev = aq_nic_get_dev(self->aq_nic); - - if (likely(buff->is_mapped)) { - if (unlikely(buff->is_sop)) { - dma_unmap_single(ndev, buff->pa, buff->len, - DMA_TO_DEVICE); - } else { - dma_unmap_page(ndev, buff->pa, buff->len, - DMA_TO_DEVICE); - } - } - - if (unlikely(buff->is_eop)) - dev_kfree_skb_any(buff->skb); - } -err_exit:; -} - void aq_ring_free(struct aq_ring_s *self) { if (!self) |