From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E3F0C433F5 for ; Sat, 30 Apr 2022 09:07:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239130AbiD3JKY (ORCPT ); Sat, 30 Apr 2022 05:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238358AbiD3JKW (ORCPT ); Sat, 30 Apr 2022 05:10:22 -0400 Received: from smtp.smtpout.orange.fr (smtp04.smtpout.orange.fr [80.12.242.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 351E17C782 for ; Sat, 30 Apr 2022 02:07:00 -0700 (PDT) Received: from [192.168.1.18] ([86.243.180.246]) by smtp.orange.fr with ESMTPA id kj42nAiNWPp5ukj42nS5Lg; Sat, 30 Apr 2022 11:06:57 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 30 Apr 2022 11:06:57 +0200 X-ME-IP: 86.243.180.246 Message-ID: Date: Sat, 30 Apr 2022 11:06:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] scsi: elx: efct: remove unnecessary memset in efct_io Content-Language: en-US To: Finn Thain , Wan Jiabing Cc: James Smart , Ram Vegesna , "James E.J. Bottomley" , "Martin K. Petersen" , Daniel Wagner , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, cocci@inria.fr References: <20220318145230.1031-1-wanjiabing@vivo.com> <794191df-e745-c591-bf1d-37945f96e73a@wanadoo.fr> From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/