0059-net-mediatek-use-dma_addr_t-correctly.patch 1.2 KB

123456789101112131415161718192021222324252627282930
  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. dma_alloc_coherent() expects a dma_addr_t pointer as its argument,
  6. not an 'unsigned int', and gcc correctly warns about broken
  7. code in the mtk_init_fq_dma function:
  8. drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_init_fq_dma':
  9. 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]
  10. This changes the type of the local variable to dma_addr_t.
  11. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  12. ---
  13. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  16. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  17. @@ -453,7 +453,7 @@ static inline void mtk_rx_get_desc(struc
  18. /* the qdma core needs scratch memory to be setup */
  19. static int mtk_init_fq_dma(struct mtk_eth *eth)
  20. {
  21. - unsigned int phy_ring_head, phy_ring_tail;
  22. + dma_addr_t phy_ring_head, phy_ring_tail;
  23. int cnt = MTK_DMA_SIZE;
  24. dma_addr_t dma_addr;
  25. int i;