Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qla2xxx: 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: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Joe Perches and committed by
Christoph Hellwig
0ea85b50 44416c42

+4 -6
+4 -6
drivers/scsi/qla2xxx/qla_init.c
··· 1526 1526 FCE_SIZE, ha->fce, ha->fce_dma); 1527 1527 1528 1528 /* Allocate memory for Fibre Channel Event Buffer. */ 1529 - tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma, 1530 - GFP_KERNEL); 1529 + tc = dma_zalloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma, 1530 + GFP_KERNEL); 1531 1531 if (!tc) { 1532 1532 ql_log(ql_log_warn, vha, 0x00be, 1533 1533 "Unable to allocate (%d KB) for FCE.\n", ··· 1535 1535 goto try_eft; 1536 1536 } 1537 1537 1538 - memset(tc, 0, FCE_SIZE); 1539 1538 rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS, 1540 1539 ha->fce_mb, &ha->fce_bufs); 1541 1540 if (rval) { ··· 1559 1560 EFT_SIZE, ha->eft, ha->eft_dma); 1560 1561 1561 1562 /* Allocate memory for Extended Trace Buffer. */ 1562 - tc = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma, 1563 - GFP_KERNEL); 1563 + tc = dma_zalloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma, 1564 + GFP_KERNEL); 1564 1565 if (!tc) { 1565 1566 ql_log(ql_log_warn, vha, 0x00c1, 1566 1567 "Unable to allocate (%d KB) for EFT.\n", ··· 1568 1569 goto cont_alloc; 1569 1570 } 1570 1571 1571 - memset(tc, 0, EFT_SIZE); 1572 1572 rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS); 1573 1573 if (rval) { 1574 1574 ql_log(ql_log_warn, vha, 0x00c2,