Skip to content

Commit e040852

Browse files
miguelinuxmartinkpetersen
authored andcommitted
scsi: storvsc: Prefer kcalloc over kzalloc with multiply
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>
1 parent 1dd0c0e commit e040852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/storvsc_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static int storvsc_channel_init(struct hv_device *device, bool is_fc)
866866
* We will however populate all the slots to evenly distribute
867867
* the load.
868868
*/
869-
stor_device->stor_chns = kzalloc(sizeof(void *) * num_possible_cpus(),
869+
stor_device->stor_chns = kcalloc(num_possible_cpus(), sizeof(void *),
870870
GFP_KERNEL);
871871
if (stor_device->stor_chns == NULL)
872872
return -ENOMEM;

0 commit comments

Comments
 (0)