Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Fang and committed by
Paolo Abeni
bc638eab bc590b47

+2 -4
+2 -4
drivers/net/ethernet/freescale/fec_main.c
··· 3770 3770 struct xdp_frame *frame) 3771 3771 { 3772 3772 unsigned int index, status, estatus; 3773 - struct bufdesc *bdp, *last_bdp; 3773 + struct bufdesc *bdp; 3774 3774 dma_addr_t dma_addr; 3775 3775 int entries_free; 3776 3776 ··· 3782 3782 3783 3783 /* Fill in a Tx ring entry */ 3784 3784 bdp = txq->bd.cur; 3785 - last_bdp = bdp; 3786 3785 status = fec16_to_cpu(bdp->cbd_sc); 3787 3786 status &= ~BD_ENET_TX_STATS; 3788 3787 ··· 3809 3810 ebdp->cbd_esc = cpu_to_fec32(estatus); 3810 3811 } 3811 3812 3812 - index = fec_enet_get_bd_index(last_bdp, &txq->bd); 3813 3813 txq->tx_skbuff[index] = NULL; 3814 3814 3815 3815 /* Make sure the updates to rest of the descriptor are performed before ··· 3823 3825 bdp->cbd_sc = cpu_to_fec16(status); 3824 3826 3825 3827 /* If this was the last BD in the ring, start at the beginning again. */ 3826 - bdp = fec_enet_get_nextdesc(last_bdp, &txq->bd); 3828 + bdp = fec_enet_get_nextdesc(bdp, &txq->bd); 3827 3829 3828 3830 /* Make sure the update to bdp are performed before txq->bd.cur. */ 3829 3831 dma_wmb();