dmaengine: mediatek: fix zalloc-simple.cocci warnings
Subsystems (3)
PATCH 1/1 dmaengine: mediatek: fix zalloc-simple.cocci warnings
From: Fengguang Wu <[email protected]>
Use zeroing allocator rather than allocator followed by memset with 0
Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
---
[auto build test WARNING on linus/master]
[also build test WARNING on v4.15 next-20180202]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
Please take the patch only if it's a positive warning. Thanks!
mtk-hsdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
drivers/dma/mediatek/mtk-hsdma.c +2 -4
@@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct* and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring. */ pc->sz_ring =2 *MTK_DMA_SIZE *sizeof (*ring->txd); - ring->txd =dma_alloc_coherent (hsdma2dev (hsdma), - pc->sz_ring, &ring->tphys, -GFP_ATOMIC | __GFP_ZERO); + ring->txd =dma_zalloc_coherent (hsdma2dev (hsdma), pc->sz_ring, + &ring->tphys,GFP_ATOMIC | __GFP_ZERO);if (!ring->txd)return -ENOMEM ; -memset (ring->txd,0 , pc->sz_ring); ring->rxd = &ring->txd[MTK_DMA_SIZE ]; ring->rphys = ring->tphys +MTK_DMA_SIZE *sizeof (*ring->txd); ring->cur_tptr =0 ;
Quoted 28 lines · Julia Lawall
From: Fengguang Wu <[email protected]>
Use zeroing allocator rather than allocator followed by memset with 0
Generated by:
scripts/coccinelle/api/alloc/zalloc-simple.cocciFixes 73006a033ef0 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")CC Sean Wang <[email protected]>Signed-off-by Fengguang Wu <[email protected]>Signed-off-by Julia Lawall <[email protected]>---
[auto build test WARNING on linus/master]
[also build test WARNING on v4.15 next-20180202]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]Please take the patch only if it's a positive warning. Thanks!
mtk-hsdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_alloc_pchan(struct · line 329
Quoted 8 lines
drivers/dma/mediatek/mtk-hsdma.c +2
-3@@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct* and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring. */ pc->sz_ring =2 *MTK_DMA_SIZE *sizeof (*ring->txd); - ring->txd =dma_alloc_coherent (hsdma2dev (hsdma), - pc->sz_ring, &ring->tphys, -GFP_ATOMIC | __GFP_ZERO); + ring->txd =dma_zalloc_coherent (hsdma2dev (hsdma), pc->sz_ring, + &ring->tphys,GFP_ATOMIC | __GFP_ZERO);
Actually, __GFP_ZERO could be dropped as well.
julia
drivers/dma/mediatek/mtk-hsdma.c static int mtk_hsdma_alloc_pchan(struct · line 335
Quoted 8 lines
drivers/dma/mediatek/mtk-hsdma.c +0
-1if (!ring->txd)return -ENOMEM ; -memset (ring->txd,0 , pc->sz_ring); ring->rxd = &ring->txd[MTK_DMA_SIZE ]; ring->rphys = ring->tphys +MTK_DMA_SIZE *sizeof (*ring->txd); ring->cur_tptr =0 ;
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html