summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-06-04 21:10:31 +0800
committerDavid S. Miller <davem@davemloft.net>2018-06-04 17:28:43 -0400
commitff2e351e1928b5b81a23d78e3e4effc24db007b9 (patch)
treed52c7d3d7b7166109de0416b3f4f14136c9c5cf3 /drivers
parent1f55c2865c21a49d882261cfa8d85635814ad8ab (diff)
downloadlinux-stable-ff2e351e1928b5b81a23d78e3e4effc24db007b9.tar.gz
linux-stable-ff2e351e1928b5b81a23d78e3e4effc24db007b9.tar.bz2
linux-stable-ff2e351e1928b5b81a23d78e3e4effc24db007b9.zip
qed: use dma_zalloc_coherent instead of allocator/memset
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Tomer Tayar <Tomer.Tayar@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_cxt.c7
1 files 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 7ed6aa0521e1..b5b5ff725426 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
@@ -937,14 +937,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;
}