From 5122be4f4fc69e507c874823efcef24e14634614 Mon Sep 17 00:00:00 2001 From: Sam Muhammed Date: Wed, 25 Mar 2020 10:26:37 -0400 Subject: [PATCH] Staging: kpc2000: kpc_dma: Use sizeof(*var) in kzalloc(). kzalloc(sizeof(*var), ...) was the format been used across the driver, which is the preferred format, but missed two instances, correct them to match the coding standards. Checkpatch.pl CHECK: Prefer kzalloc(sizeof(*var)...) over kzalloc(sizeof(struct var)...) Signed-off-by: Sam Muhammed Link: https://lore.kernel.org/r/bbb3adbd20ae89db6a0d3360bc09d22eed778e86.1585143581.git.jane.pnx9@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/kpc2000/kpc_dma/fileops.c | 2 +- drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c index 5eb6c5f24feb..21ebab7dbc7b 100644 --- a/drivers/staging/kpc2000/kpc_dma/fileops.c +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c @@ -253,7 +253,7 @@ int kpc_dma_open(struct inode *inode, struct file *filp) return -EBUSY; /* already open */ } - priv = kzalloc(sizeof(struct dev_private_data), GFP_KERNEL); + priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; diff --git a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c index ec79a8500caf..25ea16a1981e 100644 --- a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c +++ b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c @@ -98,7 +98,7 @@ int kpc_dma_probe(struct platform_device *pldev) int rv = 0; dev_t dev; - struct kpc_dma_device *ldev = kzalloc(sizeof(struct kpc_dma_device), GFP_KERNEL); + struct kpc_dma_device *ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); if (!ldev) { dev_err(&pldev->dev, "%s: unable to kzalloc space for kpc_dma_device\n", __func__);