linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Julia Lawall <Julia.Lawall@inria.fr>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	kernel-janitors@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 14/14] PCI/P2PDMA: drop double zeroing
Date: Mon, 28 Sep 2020 17:24:31 -0500	[thread overview]
Message-ID: <20200928222431.GA2501991@bjorn-Precision-5520> (raw)
In-Reply-To: <1600601186-7420-15-git-send-email-Julia.Lawall@inria.fr>

On Sun, Sep 20, 2020 at 01:26:26PM +0200, Julia Lawall wrote:
> sg_init_table zeroes its first argument, so the allocation of that argument
> doesn't have to.
> 
> the semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x;
> @@
> 
> x =
> - kzalloc
> + kmalloc
>  (...)
> ...
> sg_init_table(x,...)
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

Applied to pci/misc for v5.10, thanks!

> ---
>  drivers/pci/p2pdma.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -762,7 +762,7 @@ struct scatterlist *pci_p2pmem_alloc_sgl
>  	struct scatterlist *sg;
>  	void *addr;
>  
> -	sg = kzalloc(sizeof(*sg), GFP_KERNEL);
> +	sg = kmalloc(sizeof(*sg), GFP_KERNEL);
>  	if (!sg)
>  		return NULL;
>  
> 

  reply	other threads:[~2020-09-28 23:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20 11:26 [PATCH 00/14] drop double zeroing Julia Lawall
2020-09-20 11:26 ` [PATCH 14/14] PCI/P2PDMA: " Julia Lawall
2020-09-28 22:24   ` Bjorn Helgaas [this message]
2020-09-21 16:58 ` [PATCH 00/14] " Mark Brown
2020-09-23 15:10   ` Rolf Reintjes
2020-09-23 15:16     ` Mark Brown
2020-10-13 22:42 ` Martin K. Petersen

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=20200928222431.GA2501991@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=bhelgaas@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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).