Commit eec240e2 authored by Julia Lawall's avatar Julia Lawall Committed by Bjorn Helgaas

PCI/P2PDMA: Drop double zeroing for sg_init_table()

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>

Link: https://lore.kernel.org/r/1600601186-7420-15-git-send-email-Julia.Lawall@inria.frSigned-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 0a98bb98
......@@ -761,7 +761,7 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev,
struct scatterlist *sg;
void *addr;
sg = kzalloc(sizeof(*sg), GFP_KERNEL);
sg = kmalloc(sizeof(*sg), GFP_KERNEL);
if (!sg)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment