mirror of https://gitee.com/openkylin/linux.git
staging: kpc2000: use sizeof(var) in kzalloc call
Fixes checkpatch.pl warning "Prefer kzalloc(sizeof(*pcard)...) over kzalloc(sizeof(struct kp2000_device)...)". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a12cae870a
commit
a1ceab8b92
|
@ -317,7 +317,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
|
||||||
/*
|
/*
|
||||||
* Step 1: Allocate a struct for the pcard
|
* Step 1: Allocate a struct for the pcard
|
||||||
*/
|
*/
|
||||||
pcard = kzalloc(sizeof(struct kp2000_device), GFP_KERNEL);
|
pcard = kzalloc(sizeof(*pcard), GFP_KERNEL);
|
||||||
if (!pcard)
|
if (!pcard)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n",
|
dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n",
|
||||||
|
|
Loading…
Reference in New Issue