diff mbox series

scsi: pmcraid: Use *_pool_zalloc rather than *_pool_alloc

Message ID 1559161113902-328168114-2-diffsplit-thomas@m3y3r.de (mailing list archive)
State Deferred
Headers show
Series scsi: pmcraid: Use *_pool_zalloc rather than *_pool_alloc | expand

Commit Message

Thomas Meyer May 29, 2019, 8:21 p.m. UTC
Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

Comments

Markus Elfring Nov. 3, 2019, 4:05 p.m. UTC | #1
> Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.

Do you find a commit message nicer from a similar change suggestion?
scsi: pmcraid: Use dma_pool_zalloc rather than dma_pool_alloc
https://lore.kernel.org/linux-scsi/20190718181051.22882-1-gomonovych@gmail.com/
https://lore.kernel.org/patchwork/patch/1102040/

Regards,
Markus
Vasyl Gomonovych Nov. 14, 2019, 8:56 a.m. UTC | #2
Hi,

Yes, maybe you are right better to use the full name, sorry.

Regards Vasyl

On Sun, Nov 3, 2019 at 5:05 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
>
> Do you find a commit message nicer from a similar change suggestion?
> scsi: pmcraid: Use dma_pool_zalloc rather than dma_pool_alloc
> https://lore.kernel.org/linux-scsi/20190718181051.22882-1-gomonovych@gmail.com/
> https://lore.kernel.org/patchwork/patch/1102040/
>
> Regards,
> Markus
diff mbox series

Patch

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;
 }