projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07300f7
)
net: mediatek: use dma_zalloc_coherent instead of allocator/memset
author
YueHaibing
<
[email protected]
>
Mon, 23 Jul 2018 03:16:47 +0000
(11:16 +0800)
committer
David S. Miller
<
[email protected]
>
Mon, 23 Jul 2018 03:51:40 +0000
(20:51 -0700)
Use dma_zalloc_coherent instead of dma_alloc_coherent
followed by memset 0.
Signed-off-by: YueHaibing <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/mediatek/mtk_eth_soc.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index d8ebf0a05e0c4fc99387338db9962bbab3f7472e..c30aea2ab7673e055e686c153bd338432a6f1249 100644
(file)
--- a/
drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/
drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@
-1221,14
+1221,11
@@
static int mtk_tx_alloc(struct mtk_eth *eth)
if (!ring->buf)
goto no_tx_mem;
- ring->dma = dma_alloc_coherent(eth->dev,
- MTK_DMA_SIZE * sz,
- &ring->phys,
- GFP_ATOMIC | __GFP_ZERO);
+ ring->dma = dma_zalloc_coherent(eth->dev, MTK_DMA_SIZE * sz,
+ &ring->phys, GFP_ATOMIC);
if (!ring->dma)
goto no_tx_mem;
- memset(ring->dma, 0, MTK_DMA_SIZE * sz);
for (i = 0; i < MTK_DMA_SIZE; i++) {
int next = (i + 1) % MTK_DMA_SIZE;
u32 next_ptr = ring->phys + next * sz;