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 <jane.pnx9@gmail.com> Link: https://lore.kernel.org/r/bbb3adbd20ae89db6a0d3360bc09d22eed778e86.1585143581.git.jane.pnx9@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
0af192c755
Коммит
5122be4f4f
|
@ -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;
|
||||
|
||||
|
|
|
@ -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__);
|
||||
|
|
Загрузка…
Ссылка в новой задаче