]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: crystalhd: Improve kzalloc calls in crystalhd_lnx.c
authorPascal COMBES <pascom@orange.fr>
Tue, 15 Apr 2014 19:21:37 +0000 (21:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Apr 2014 23:22:15 +0000 (16:22 -0700)
Replace sizeof(type) by sizeof(variable) in crystalhd_lnx.c.

Signed-off-by: Pascal COMBES <pascom@orange.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/crystalhd/crystalhd_lnx.c

index 0e432bcf7c13a71e3db489504a6f659572ef91d7..e6fb331c6735492e1a1fcf26012c2f429c6833b7 100644 (file)
@@ -399,8 +399,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
 
        /* Allocate general purpose ioctl pool. */
        for (i = 0; i < CHD_IODATA_POOL_SZ; i++) {
-               temp = kzalloc(sizeof(struct crystalhd_ioctl_data),
-                              GFP_KERNEL);
+               temp = kzalloc(sizeof(*temp), GFP_KERNEL);
                if (!temp) {
                        BCMLOG_ERR("ioctl data pool kzalloc failed\n");
                        rc = -ENOMEM;
@@ -555,7 +554,7 @@ static int chd_dec_pci_probe(struct pci_dev *pdev,
               pdev->vendor, pdev->device, pdev->subsystem_vendor,
               pdev->subsystem_device);
 
-       pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL);
+       pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL);
        if (!pinfo) {
                BCMLOG_ERR("Failed to allocate memory\n");
                return -ENOMEM;