diff mbox series

scsi/pmcraid.c: Use dma_pool_zalloc

Message ID 20181002052631.GA2853@jordon-HP-15-Notebook-PC (mailing list archive)
State Deferred
Headers show
Series scsi/pmcraid.c: Use dma_pool_zalloc | expand

Commit Message

Souptick Joarder Oct. 2, 2018, 5:26 a.m. UTC
Replaced dma_pool_alloc + memset with dma_pool_zalloc.

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/scsi/pmcraid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Souptick Joarder Oct. 8, 2018, 4:28 p.m. UTC | #1
On Tue, Oct 2, 2018 at 10:53 AM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> Replaced dma_pool_alloc + memset with dma_pool_zalloc.
>
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Any comment on this patch ?

> ---
>  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 4e86994..84a2734 100644
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -4681,7 +4681,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));
> @@ -4690,8 +4690,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;
>  }
> --
> 1.9.1
>
Souptick Joarder Oct. 24, 2018, 3:36 a.m. UTC | #2
On Mon, Oct 8, 2018 at 9:58 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> On Tue, Oct 2, 2018 at 10:53 AM Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >
> > Replaced dma_pool_alloc + memset with dma_pool_zalloc.
> >
> > Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> > Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>
> Any comment on this patch ?

Any comment on this patch ?

>
> > ---
> >  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 4e86994..84a2734 100644
> > --- a/drivers/scsi/pmcraid.c
> > +++ b/drivers/scsi/pmcraid.c
> > @@ -4681,7 +4681,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));
> > @@ -4690,8 +4690,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;
> >  }
> > --
> > 1.9.1
> >
diff mbox series

Patch

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 4e86994..84a2734 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4681,7 +4681,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));
@@ -4690,8 +4690,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;
 }