Skip to content

Commit

Permalink
scsi: storvsc: Prefer kcalloc over kzalloc with multiply
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miguel Bernal Marin authored and Martin K. Petersen committed Apr 14, 2017
1 parent 1dd0c0e commit e040852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e040852

Please sign in to comment.