mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
net: fec: remove last_bdp from fec_enet_txq_xmit_frame()
The last_bdp is initialized to bdp, and both last_bdp and bdp are not changed. That is to say that last_bdp and bdp are always equal. So bdp can be used directly. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230529022615.669589-1-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
bc590b4754
commit
bc638eabfe
1 changed files with 2 additions and 4 deletions
|
@ -3770,7 +3770,7 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
|
||||||
struct xdp_frame *frame)
|
struct xdp_frame *frame)
|
||||||
{
|
{
|
||||||
unsigned int index, status, estatus;
|
unsigned int index, status, estatus;
|
||||||
struct bufdesc *bdp, *last_bdp;
|
struct bufdesc *bdp;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
int entries_free;
|
int entries_free;
|
||||||
|
|
||||||
|
@ -3782,7 +3782,6 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
|
||||||
|
|
||||||
/* Fill in a Tx ring entry */
|
/* Fill in a Tx ring entry */
|
||||||
bdp = txq->bd.cur;
|
bdp = txq->bd.cur;
|
||||||
last_bdp = bdp;
|
|
||||||
status = fec16_to_cpu(bdp->cbd_sc);
|
status = fec16_to_cpu(bdp->cbd_sc);
|
||||||
status &= ~BD_ENET_TX_STATS;
|
status &= ~BD_ENET_TX_STATS;
|
||||||
|
|
||||||
|
@ -3810,7 +3809,6 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
|
||||||
ebdp->cbd_esc = cpu_to_fec32(estatus);
|
ebdp->cbd_esc = cpu_to_fec32(estatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
index = fec_enet_get_bd_index(last_bdp, &txq->bd);
|
|
||||||
txq->tx_skbuff[index] = NULL;
|
txq->tx_skbuff[index] = NULL;
|
||||||
|
|
||||||
/* Make sure the updates to rest of the descriptor are performed before
|
/* Make sure the updates to rest of the descriptor are performed before
|
||||||
|
@ -3825,7 +3823,7 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
|
||||||
bdp->cbd_sc = cpu_to_fec16(status);
|
bdp->cbd_sc = cpu_to_fec16(status);
|
||||||
|
|
||||||
/* If this was the last BD in the ring, start at the beginning again. */
|
/* If this was the last BD in the ring, start at the beginning again. */
|
||||||
bdp = fec_enet_get_nextdesc(last_bdp, &txq->bd);
|
bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
|
||||||
|
|
||||||
/* Make sure the update to bdp are performed before txq->bd.cur. */
|
/* Make sure the update to bdp are performed before txq->bd.cur. */
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
|
|
Loading…
Reference in a new issue