* [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset
@ 2018-06-04 13:10 YueHaibing
2018-06-04 14:53 ` Tayar, Tomer
2018-06-04 21:28 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-06-04 13:10 UTC (permalink / raw)
To: davem, Ariel.Elior; +Cc: netdev, linux-kernel, everest-linux-l2, YueHaibing
Use dma_zalloc_coherent instead of dma_alloc_coherent
followed by memset 0.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/net/ethernet/qlogic/qed/qed_cxt.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
index 820b226..1835f00 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
@@ -936,14 +936,13 @@ static int qed_cxt_src_t2_alloc(struct qed_hwfn *p_hwfn)
u32 size = min_t(u32, total_size, psz);
void **p_virt = &p_mngr->t2[i].p_virt;
- *p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
- size,
- &p_mngr->t2[i].p_phys, GFP_KERNEL);
+ *p_virt = dma_zalloc_coherent(&p_hwfn->cdev->pdev->dev,
+ size, &p_mngr->t2[i].p_phys,
+ GFP_KERNEL);
if (!p_mngr->t2[i].p_virt) {
rc = -ENOMEM;
goto t2_fail;
}
- memset(*p_virt, 0, size);
p_mngr->t2[i].size = size;
total_size -= size;
}
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset
2018-06-04 13:10 [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset YueHaibing
@ 2018-06-04 14:53 ` Tayar, Tomer
2018-06-04 21:28 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Tayar, Tomer @ 2018-06-04 14:53 UTC (permalink / raw)
To: YueHaibing, davem, Elior, Ariel
Cc: netdev, linux-kernel, Dept-Eng Everest Linux L2
From: YueHaibing [mailto:yuehaibing@huawei.com]
Sent: Monday, June 04, 2018 4:11 PM
> Use dma_zalloc_coherent instead of dma_alloc_coherent
> followed by memset 0.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Thanks
Acked-by: Tomer Tayar <Tomer.Tayar@cavium.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset
2018-06-04 13:10 [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset YueHaibing
2018-06-04 14:53 ` Tayar, Tomer
@ 2018-06-04 21:28 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-06-04 21:28 UTC (permalink / raw)
To: yuehaibing; +Cc: Ariel.Elior, netdev, linux-kernel, everest-linux-l2
From: YueHaibing <yuehaibing@huawei.com>
Date: Mon, 4 Jun 2018 21:10:31 +0800
> Use dma_zalloc_coherent instead of dma_alloc_coherent
> followed by memset 0.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-04 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-04 13:10 [PATCH net-next] qed: use dma_zalloc_coherent instead of allocator/memset YueHaibing
2018-06-04 14:53 ` Tayar, Tomer
2018-06-04 21:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).