diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2023-01-18 00:02:23 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-01-19 05:52:25 +0100 |
commit | 1cbf19c575ddbec27eec99396329810b1a5f7976 (patch) | |
tree | def283887e8569835fc8a3ca533e216fcc313169 /drivers/net/ethernet/freescale | |
parent | xdp: document xdp_do_flush() before napi_complete_done() (diff) | |
download | linux-1cbf19c575ddbec27eec99396329810b1a5f7976.tar.xz linux-1cbf19c575ddbec27eec99396329810b1a5f7976.zip |
net: enetc: set next_to_clean/next_to_use just from enetc_setup_txbdr()
enetc_alloc_txbdr() deals with allocating resources necessary for a TX
ring to work (the array of software BDs and the array of TSO headers).
The next_to_clean and next_to_use pointers are overwritten with proper
values which are read from hardware here:
enetc_open
-> enetc_alloc_tx_resources
-> enetc_alloc_txbdr
-> set to zero
-> enetc_setup_bdrs
-> enetc_setup_txbdr
-> read from hardware
So their initialization with zeroes is pointless and confusing.
Delete it.
Consequently, since enetc_setup_txbdr() has no opposite cleanup
function, also delete the resetting of these indices from
enetc_free_tx_ring().
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/enetc/enetc.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 5ad0b259e623..911686df16e4 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -1753,9 +1753,6 @@ static int enetc_alloc_txbdr(struct enetc_bdr *txr) goto err_alloc_tso; } - txr->next_to_clean = 0; - txr->next_to_use = 0; - return 0; err_alloc_tso: @@ -1897,9 +1894,6 @@ static void enetc_free_tx_ring(struct enetc_bdr *tx_ring) enetc_free_tx_frame(tx_ring, tx_swbd); } - - tx_ring->next_to_clean = 0; - tx_ring->next_to_use = 0; } static void enetc_free_rx_ring(struct enetc_bdr *rx_ring) |