[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1559161113902-328168114-2-diffsplit-thomas@m3y3r.de>
Date: Wed, 29 May 2019 22:21:40 +0200
From: "Thomas Meyer" <thomas@...3r.de>
To: jejb@...ux.ibm.com, martin.petersen@...cle.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] scsi: pmcraid: Use *_pool_zalloc rather than *_pool_alloc
Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
Signed-off-by: Thomas Meyer <thomas@...3r.de>
---
diff -u -p a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4668,18 +4668,14 @@ static int pmcraid_allocate_control_bloc
return -ENOMEM;
for (i = 0; i < PMCRAID_MAX_CMD; i++) {
- pinstance->cmd_list[i]->ioa_cb =
- dma_pool_alloc(
- pinstance->control_pool,
- GFP_KERNEL,
- &(pinstance->cmd_list[i]->ioa_cb_bus_addr));
+ pinstance->cmd_list[i]->ioa_cb = dma_pool_zalloc(pinstance->control_pool,
+ GFP_KERNEL,
+ &(pinstance->cmd_list[i]->ioa_cb_bus_addr));
if (!pinstance->cmd_list[i]->ioa_cb) {
pmcraid_release_control_blocks(pinstance, i);
return -ENOMEM;
}
- memset(pinstance->cmd_list[i]->ioa_cb, 0,
- sizeof(struct pmcraid_control_block));
}
return 0;
}
Powered by blists - more mailing lists