aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000
diff options
context:
space:
mode:
authorSam Muhammed <jane.pnx9@gmail.com>2020-03-25 10:26:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-25 19:38:40 +0100
commitedf279abbac989ebd70c954bf1cd5a25157a78e5 (patch)
tree283e1f62897660bfa5404a5b279b973002f79fb1 /drivers/staging/kpc2000
parentStaging: kpc2000: kpc_dma: Use the SPDK comment style. (diff)
downloadlinux-dev-edf279abbac989ebd70c954bf1cd5a25157a78e5.tar.xz
linux-dev-edf279abbac989ebd70c954bf1cd5a25157a78e5.zip
Staging: kpc2000: kpc_dma: Use kcalloc over kzalloc.
Replace kzalloc(sizeof(...) * n, ...) with kcalloc(n, sizeof(...), ...) since kcalloc is the preferred API in case of allocating with multiply. Checkpatch.pl: WARNING: Prefer kcalloc over kzalloc with multiply. Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com> Link: https://lore.kernel.org/r/4b8339d1e81e497c3c2f0dad57a9587338ec82b1.1585143581.git.jane.pnx9@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/kpc2000')
-rw-r--r--drivers/staging/kpc2000/kpc_dma/fileops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index d80d894f3aac..8c7859ed1237 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -66,7 +66,8 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
acd->page_count = count_pages(iov_base, iov_len);
// Allocate an array of page pointers
- acd->user_pages = kzalloc(sizeof(struct page *) * acd->page_count, GFP_KERNEL);
+ acd->user_pages = kcalloc(acd->page_count, sizeof(struct page *),
+ GFP_KERNEL);
if (!acd->user_pages) {
dev_err(&priv->ldev->pldev->dev, "Couldn't kmalloc space for for the page pointers\n");
rv = -ENOMEM;