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

net: ethernet: mediatek: Rename NEXT_RX_DESP_IDX to NEXT_DESP_IDX

Rename the NEXT_RX_DESP_IDX macro to NEXT_DESP_IDX, so that it better
can be used for TX ops as well. This will be used in the upcoming
MT7628/88 support (same functionality for RX and TX in this macro).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: René van Dorst <opensource@vdorst.com>
Cc: Daniel Golle <daniel@makrotopia.org>
Cc: Sean Wang <sean.wang@mediatek.com>
Cc: John Crispin <john@phrozen.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stefan Roese and committed by
David S. Miller
08df5fa6 45487403

+3 -3
+2 -2
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 903 903 904 904 for (i = 0; i < MTK_MAX_RX_RING_NUM; i++) { 905 905 ring = &eth->rx_ring[i]; 906 - idx = NEXT_RX_DESP_IDX(ring->calc_idx, ring->dma_size); 906 + idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); 907 907 if (ring->dma[idx].rxd2 & RX_DMA_DONE) { 908 908 ring->calc_idx_update = true; 909 909 return ring; ··· 952 952 if (unlikely(!ring)) 953 953 goto rx_done; 954 954 955 - idx = NEXT_RX_DESP_IDX(ring->calc_idx, ring->dma_size); 955 + idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); 956 956 rxd = &ring->dma[idx]; 957 957 data = ring->data[idx]; 958 958
+1 -1
drivers/net/ethernet/mediatek/mtk_eth_soc.h
··· 39 39 NETIF_F_SG | NETIF_F_TSO | \ 40 40 NETIF_F_TSO6 | \ 41 41 NETIF_F_IPV6_CSUM) 42 - #define NEXT_RX_DESP_IDX(X, Y) (((X) + 1) & ((Y) - 1)) 42 + #define NEXT_DESP_IDX(X, Y) (((X) + 1) & ((Y) - 1)) 43 43 44 44 #define MTK_MAX_RX_RING_NUM 4 45 45 #define MTK_HW_LRO_DMA_SIZE 8