staging: kpc2000: use sizeof(var) in kzalloc call
authorSimon Sandström <simon@nikanor.nu>
Mon, 3 Jun 2019 22:29:15 +0000 (00:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jun 2019 12:57:01 +0000 (14:57 +0200)
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>
drivers/staging/kpc2000/kpc2000/core.c

index 3f17566a9d03cccf4161c0b233345b5dd023fc1c..2d8d188624f79067ae3ee615d9f8d74feeca538b 100644 (file)
@@ -317,7 +317,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
        /*
         * Step 1: Allocate a struct for the pcard
         */
-       pcard = kzalloc(sizeof(struct kp2000_device), GFP_KERNEL);
+       pcard = kzalloc(sizeof(*pcard), GFP_KERNEL);
        if (!pcard)
                return -ENOMEM;
        dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n",