f7318e68bbdd17517bbceaf2ce544dec39603ca9
[openwrt/staging/ldir.git] /
1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Fri, 20 May 2022 20:11:38 +0200
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: convert scratch_ring pointer to
4 void
5
6 Simplify the code converting scratch_ring pointer to void
7
8 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
9 Signed-off-by: David S. Miller <davem@davemloft.net>
10 ---
11
12 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
13 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
14 @@ -923,7 +923,7 @@ static int mtk_init_fq_dma(struct mtk_et
15 for (i = 0; i < cnt; i++) {
16 struct mtk_tx_dma_v2 *txd;
17
18 - txd = (void *)eth->scratch_ring + i * soc->txrx.txd_size;
19 + txd = eth->scratch_ring + i * soc->txrx.txd_size;
20 txd->txd1 = dma_addr + i * MTK_QDMA_PAGE_SIZE;
21 if (i < cnt - 1)
22 txd->txd2 = eth->phy_scratch_ring +
23 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
24 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
25 @@ -1029,7 +1029,7 @@ struct mtk_eth {
26 struct mtk_rx_ring rx_ring_qdma;
27 struct napi_struct tx_napi;
28 struct napi_struct rx_napi;
29 - struct mtk_tx_dma *scratch_ring;
30 + void *scratch_ring;
31 dma_addr_t phy_scratch_ring;
32 void *scratch_head;
33 struct clk *clks[MTK_CLK_MAX];