linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: Himanshu Jha <himanshujha199640@gmail.com>
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, mcgrof@kernel.org,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH] scsi: Use vzalloc instead of vmalloc/memset
Date: Tue, 7 Nov 2017 20:51:36 +0100	[thread overview]
Message-ID: <20171107195136.GD22894@wotan.suse.de> (raw)
In-Reply-To: <1509832586-1429-1-git-send-email-himanshujha199640@gmail.com>

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 <himanshujha199640@gmail.com>
> ---
>  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:

Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>

  reply	other threads:[~2017-11-07 19:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-04 21:56 [PATCH] scsi: Use vzalloc instead of vmalloc/memset Himanshu Jha
2017-11-07 19:51 ` Luis R. Rodriguez [this message]
2017-11-07 21:00   ` Himanshu Jha
2017-11-07 23:43     ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171107195136.GD22894@wotan.suse.de \
    --to=mcgrof@kernel.org \
    --cc=anil.gurumurthy@qlogic.com \
    --cc=himanshujha199640@gmail.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kartilak@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qla2xxx-upstream@qlogic.com \
    --cc=sebaddel@cisco.com \
    --cc=sudarsana.kalluru@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).