Skip to content

Commit 7626d9f

Browse files
JoePerchesChristoph Hellwig
authored andcommitted
bfa: Use dma_zalloc_coherent
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 1f3d2d9 commit 7626d9f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/scsi/bfa/bfad_bsg.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,13 +3270,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
32703270
/* Allocate dma coherent memory */
32713271
buf_info = buf_base;
32723272
buf_info->size = payload_len;
3273-
buf_info->virt = dma_alloc_coherent(&bfad->pcidev->dev, buf_info->size,
3274-
&buf_info->phys, GFP_KERNEL);
3273+
buf_info->virt = dma_zalloc_coherent(&bfad->pcidev->dev,
3274+
buf_info->size, &buf_info->phys,
3275+
GFP_KERNEL);
32753276
if (!buf_info->virt)
32763277
goto out_free_mem;
32773278

32783279
/* copy the linear bsg buffer to buf_info */
3279-
memset(buf_info->virt, 0, buf_info->size);
32803280
memcpy(buf_info->virt, payload_kbuf, buf_info->size);
32813281

32823282
/*

0 commit comments

Comments
 (0)