[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c920e37a-b690-e614-c052-634177bbeb46@wanadoo.fr>
Date: Sat, 30 Apr 2022 11:06:53 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Finn Thain <fthain@...ux-m68k.org>,
Wan Jiabing <wanjiabing@...o.com>
Cc: 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,
cocci@...ia.fr
Subject: Re: [PATCH] scsi: elx: efct: remove unnecessary memset in efct_io
Le 30/04/2022 à 09:48, Finn Thain a écrit :
> On Sat, 30 Apr 2022, Christophe JAILLET wrote:
>
>> 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.
>>
>
> Seems like kcalloc() conversion could be a separate patch. Perhaps it
> could be done everywhere using a coccinelle script.
Sure it can and I guess that many coccinelle script already exist for it.
I only replied here because of a comment from Joe Perches on the same
patch a few month ago (see [1] and [2])
So Wan Jiabing or anyone else, if you want to go one step further, just
feel free to propose it.
CJ
[1]:
https://lore.kernel.org/all/4208b3d08a677601c73889f78dd25e5c9f056a86.camel@perches.com/
[2]:
https://lore.kernel.org/all/9be7d5beb437583f8d975d168ac5c3e32fb6e465.1639158677.git.christophe.jaillet@wanadoo.fr/
Powered by blists - more mailing lists