Skip to content

Commit bc638ea

Browse files
Wei FangPaolo Abeni
authored andcommitted
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent bc590b4 commit bc638ea

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,7 +3770,7 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
37703770
struct xdp_frame *frame)
37713771
{
37723772
unsigned int index, status, estatus;
3773-
struct bufdesc *bdp, *last_bdp;
3773+
struct bufdesc *bdp;
37743774
dma_addr_t dma_addr;
37753775
int entries_free;
37763776

@@ -3782,7 +3782,6 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
37823782

37833783
/* Fill in a Tx ring entry */
37843784
bdp = txq->bd.cur;
3785-
last_bdp = bdp;
37863785
status = fec16_to_cpu(bdp->cbd_sc);
37873786
status &= ~BD_ENET_TX_STATS;
37883787

@@ -3810,7 +3809,6 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep,
38103809
ebdp->cbd_esc = cpu_to_fec32(estatus);
38113810
}
38123811

3813-
index = fec_enet_get_bd_index(last_bdp, &txq->bd);
38143812
txq->tx_skbuff[index] = NULL;
38153813

38163814
/* 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,
38253823
bdp->cbd_sc = cpu_to_fec16(status);
38263824

38273825
/* If this was the last BD in the ring, start at the beginning again. */
3828-
bdp = fec_enet_get_nextdesc(last_bdp, &txq->bd);
3826+
bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
38293827

38303828
/* Make sure the update to bdp are performed before txq->bd.cur. */
38313829
dma_wmb();

0 commit comments

Comments
 (0)