scsi: pmcraid: Replace dma_pool_malloc with dma_pool_zalloc
Replace dma_pool_malloc with dma_pool_zalloc to make the code more concise in pmcraid_allocate_control_blocks() function. Link: https://lore.kernel.org/r/1587197241-274646-1-git-send-email-wubo40@huawei.com Signed-off-by: Wu Bo <wubo40@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
7c59dace7e
commit
f8f794a15a
@ -4652,7 +4652,7 @@ static int pmcraid_allocate_control_blocks(struct pmcraid_instance *pinstance)
|
|||||||
|
|
||||||
for (i = 0; i < PMCRAID_MAX_CMD; i++) {
|
for (i = 0; i < PMCRAID_MAX_CMD; i++) {
|
||||||
pinstance->cmd_list[i]->ioa_cb =
|
pinstance->cmd_list[i]->ioa_cb =
|
||||||
dma_pool_alloc(
|
dma_pool_zalloc(
|
||||||
pinstance->control_pool,
|
pinstance->control_pool,
|
||||||
GFP_KERNEL,
|
GFP_KERNEL,
|
||||||
&(pinstance->cmd_list[i]->ioa_cb_bus_addr));
|
&(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);
|
pmcraid_release_control_blocks(pinstance, i);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset(pinstance->cmd_list[i]->ioa_cb, 0,
|
|
||||||
sizeof(struct pmcraid_control_block));
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user