]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
scsi: storvsc: Prefer kcalloc over kzalloc with multiply
authorMiguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Thu, 16 Mar 2017 06:58:23 +0000 (00:58 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 14 Apr 2017 03:04:02 +0000 (23:04 -0400)
Use kcalloc for allocating an array instead of kzalloc with multiply,
kcalloc is the preferred API.

Found with checkpatch.

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/storvsc_drv.c

index 638e5f427c901fddee96a53328cd8cc76f1368be..3d70d1cf49a3edbe1a2eacc4802e77605c3f8d4a 100644 (file)
@@ -866,7 +866,7 @@ static int storvsc_channel_init(struct hv_device *device, bool is_fc)
         * We will however populate all the slots to evenly distribute
         * the load.
         */
-       stor_device->stor_chns = kzalloc(sizeof(void *) * num_possible_cpus(),
+       stor_device->stor_chns = kcalloc(num_possible_cpus(), sizeof(void *),
                                         GFP_KERNEL);
        if (stor_device->stor_chns == NULL)
                return -ENOMEM;