From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933699AbdKGVA6 (ORCPT ); Tue, 7 Nov 2017 16:00:58 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:55225 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933563AbdKGVA4 (ORCPT ); Tue, 7 Nov 2017 16:00:56 -0500 X-Google-Smtp-Source: ABhQp+SRKda6m0ptrEsSIHh++tA/i8huq2Tjty8cOLrUd1NuDFly4YmyV4Qacg86cVXr/f+VelmShQ== Date: Wed, 8 Nov 2017 02:30:46 +0530 From: Himanshu Jha To: "Luis R. Rodriguez" Cc: anil.gurumurthy@qlogic.com, sudarsana.kalluru@qlogic.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, qla2xxx-upstream@qlogic.com, kartilak@cisco.com, sebaddel@cisco.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Julia Lawall Subject: Re: [PATCH] scsi: Use vzalloc instead of vmalloc/memset Message-ID: <20171107210046.GA3948@himanshu-Vostro-3559> References: <1509832586-1429-1-git-send-email-himanshujha199640@gmail.com> <20171107195136.GD22894@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171107195136.GD22894@wotan.suse.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 07, 2017 at 08:51:36PM +0100, Luis R. Rodriguez wrote: > On Sun, Nov 05, 2017 at 03:26:26AM +0530, Himanshu Jha wrote: > > Use vzalloc instead of vmalloc/memset to allocate memory filled with 0 > > value. > > > > Done using Coccinelle. > > Semantic patch used : > > > > @@ > > expression x,a; > > statement S; > > @@ > > > > - x = vmalloc(a); > > + x = vzalloc(a); > > if (x == NULL || ...) S > > - memset(x, 0, a); > > How many false positives do you get? Have you identified any? > If not you should consider adding this SmPL rule to: > > scripts/coccinelle/api/ > > Some maintainers may ask you for the SmPL rule to be upstream first, > not all though. So its good practice for you to strive for this. > Another reason for it to go upstream is then other maintainers > can / should be running coccicheck against their subsystem to avoid > stupid regressions. > > You may want to explain for patches like these that they have been > tested by 0-day without any issues found. > > Also add the tag: > > Generated-by: Coccinelle SmPL > > > Signed-off-by: Himanshu Jha > > --- > > drivers/scsi/bfa/bfad.c | 3 +-- > > drivers/scsi/bfa/bfad_debugfs.c | 8 ++------ > > drivers/scsi/qla2xxx/qla_bsg.c | 3 +-- > > drivers/scsi/qla2xxx/tcm_qla2xxx.c | 5 +---- > > drivers/scsi/scsi_debug.c | 6 ++---- > > drivers/scsi/snic/snic_trc.c | 3 +-- > > 6 files changed, 8 insertions(+), 20 deletions(-) > > Split this up per driver, and resend by using ./scripts/get_maintainer.pl > foo.patch and ensuring the right folks get the email. Right now you > just spammed tons of people and the changes may be preferred to go > upstream atomically per driver, always assume this first. > > Other than this, feel free to add to each of the patches you created: > Thanks for the feeedback! I will resend the patch with the necessary changes. > Acked-by: Luis R. Rodriguez Thanks Himanshu Jha