[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <596a6bd4-88b3-4836-94ec-b2930c9b0062@wdc.com>
Date: Tue, 8 Oct 2024 10:25:09 +0000
From: Johannes Thumshirn <Johannes.Thumshirn@....com>
To: Thorsten Blum <thorsten.blum@...ux.dev>, Satish Kharat
<satishkh@...co.com>, Sesidhar Baddela <sebaddel@...co.com>, Karan Tilak
Kumar <kartilak@...co.com>, "James E.J. Bottomley"
<James.Bottomley@...senPartnership.com>, "Martin K. Petersen"
<martin.petersen@...cle.com>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] scsi: fnic: Use vzalloc() instead of vmalloc() and
memset(0)
On 08.10.24 11:53, Thorsten Blum wrote:
> Use vzalloc() instead of vmalloc() followed by memset(0) to simplify the
> functions fnic_trace_buf_init() and fnic_fc_trace_init().
>
> Remove unnecessary unsigned long cast.
>
> Compile-tested only.
>
> Cc: Johannes Thumshirn <johannes.thumshirn@....com>
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
> Changes in v2:
> - Remove unsigned long cast as suggested by Johannes Thumshirn
> - Link to v1: https://lore.kernel.org/linux-kernel/20241007115840.2239-6-thorsten.blum@linux.dev/
> ---
> drivers/scsi/fnic/fnic_trace.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c
> index aaa4ea02fb7c..c2413e0e4eaa 100644
> --- a/drivers/scsi/fnic/fnic_trace.c
> +++ b/drivers/scsi/fnic/fnic_trace.c
> @@ -485,7 +485,7 @@ int fnic_trace_buf_init(void)
> }
>
> fnic_trace_entries.page_offset =
> - vmalloc(array_size(fnic_max_trace_entries,
> + vzalloc(array_size(fnic_max_trace_entries,
> sizeof(unsigned long)));
Sorry for not having spotted it earlier, but all those
vzalloc(array_size(foo, bar)); calls can be turned into vcalloc(foo, bar);
Powered by blists - more mailing lists