* [PATCH next] scsi: pmcraid: replace dma_pool_alloc + memset with dma_pool_zalloc
@ 2020-01-02 1:47 Chen Zhou
0 siblings, 0 replies; only message in thread
From: Chen Zhou @ 2020-01-02 1:47 UTC (permalink / raw)
To: martin.petersen, jejb; +Cc: linux-scsi, linux-kernel, chenzhou10
Use dma_pool_zalloc rather than dma_pool_alloc followed by memset with 0.
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
drivers/scsi/pmcraid.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 7eb88fe..aa9ae2a 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4652,7 +4652,7 @@ static int pmcraid_allocate_control_blocks(struct pmcraid_instance *pinstance)
for (i = 0; i < PMCRAID_MAX_CMD; i++) {
pinstance->cmd_list[i]->ioa_cb =
- dma_pool_alloc(
+ dma_pool_zalloc(
pinstance->control_pool,
GFP_KERNEL,
&(pinstance->cmd_list[i]->ioa_cb_bus_addr));
@@ -4661,8 +4661,6 @@ static int pmcraid_allocate_control_blocks(struct pmcraid_instance *pinstance)
pmcraid_release_control_blocks(pinstance, i);
return -ENOMEM;
}
- memset(pinstance->cmd_list[i]->ioa_cb, 0,
- sizeof(struct pmcraid_control_block));
}
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-02 1:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 1:47 [PATCH next] scsi: pmcraid: replace dma_pool_alloc + memset with dma_pool_zalloc Chen Zhou
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).