f428d0b618f940f50ddb49c362b627aafabb446b
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.4 / 0059-net-mediatek-use-dma_addr_t-correctly.patch
1 From a572747434b6153e75812c5466c0557e5ed69284 Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Mon, 14 Mar 2016 15:07:10 +0100
4 Subject: [PATCH 059/102] net: mediatek: use dma_addr_t correctly
5
6 dma_alloc_coherent() expects a dma_addr_t pointer as its argument,
7 not an 'unsigned int', and gcc correctly warns about broken
8 code in the mtk_init_fq_dma function:
9
10 drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_init_fq_dma':
11 drivers/net/ethernet/mediatek/mtk_eth_soc.c:463:13: error: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types]
12
13 This changes the type of the local variable to dma_addr_t.
14
15 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
16 ---
17 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
21 index c2c2e206..a005bc4 100644
22 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
23 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
24 @@ -453,7 +453,7 @@ static inline void mtk_rx_get_desc(struct mtk_rx_dma *rxd,
25 /* the qdma core needs scratch memory to be setup */
26 static int mtk_init_fq_dma(struct mtk_eth *eth)
27 {
28 - unsigned int phy_ring_head, phy_ring_tail;
29 + dma_addr_t phy_ring_head, phy_ring_tail;
30 int cnt = MTK_DMA_SIZE;
31 dma_addr_t dma_addr;
32 int i;
33 --
34 1.7.10.4
35