提交 7626d9f3 编写于 作者: J Joe Perches 提交者: Christoph Hellwig

bfa: Use dma_zalloc_coherent

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
Signed-off-by: NJoe Perches <joe@perches.com>
Acked-by: NAnil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 1f3d2d9e
...@@ -3270,13 +3270,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf, ...@@ -3270,13 +3270,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
/* Allocate dma coherent memory */ /* Allocate dma coherent memory */
buf_info = buf_base; buf_info = buf_base;
buf_info->size = payload_len; buf_info->size = payload_len;
buf_info->virt = dma_alloc_coherent(&bfad->pcidev->dev, buf_info->size, buf_info->virt = dma_zalloc_coherent(&bfad->pcidev->dev,
&buf_info->phys, GFP_KERNEL); buf_info->size, &buf_info->phys,
GFP_KERNEL);
if (!buf_info->virt) if (!buf_info->virt)
goto out_free_mem; goto out_free_mem;
/* copy the linear bsg buffer to buf_info */ /* copy the linear bsg buffer to buf_info */
memset(buf_info->virt, 0, buf_info->size);
memcpy(buf_info->virt, payload_kbuf, buf_info->size); memcpy(buf_info->virt, payload_kbuf, buf_info->size);
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册