[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <794191df-e745-c591-bf1d-37945f96e73a@wanadoo.fr>
Date: Sat, 30 Apr 2022 08:29:46 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Wan Jiabing <wanjiabing@...o.com>,
James Smart <james.smart@...adcom.com>,
Ram Vegesna <ram.vegesna@...adcom.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Daniel Wagner <dwagner@...e.de>, linux-scsi@...r.kernel.org,
target-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: elx: efct: remove unnecessary memset in efct_io
Le 18/03/2022 à 15:52, Wan Jiabing a écrit :
> io->sgl is allocated by kzalloc(). The memory is set to zero.
> It is unnecessary to call memset again.
>
Hi,
Nitpick: this kzalloc() should be a kcalloc() to avoid an open-coded
multiplication when computing the size to allocate.
CJ
> Signed-off-by: Wan Jiabing <wanjiabing@...o.com>
> ---
> drivers/scsi/elx/efct/efct_io.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/scsi/elx/efct/efct_io.c b/drivers/scsi/elx/efct/efct_io.c
> index c3247b951a76..c612f0a48839 100644
> --- a/drivers/scsi/elx/efct/efct_io.c
> +++ b/drivers/scsi/elx/efct/efct_io.c
> @@ -62,7 +62,6 @@ efct_io_pool_create(struct efct *efct, u32 num_sgl)
> return NULL;
> }
>
> - memset(io->sgl, 0, sizeof(*io->sgl) * num_sgl);
> io->sgl_allocated = num_sgl;
> io->sgl_count = 0;
>
Powered by blists - more mailing lists