From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbdCPHB7 (ORCPT ); Thu, 16 Mar 2017 03:01:59 -0400 Received: from mga14.intel.com ([192.55.52.115]:24390 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751137AbdCPHB6 (ORCPT ); Thu, 16 Mar 2017 03:01:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,170,1486454400"; d="scan'208";a="67886087" From: Miguel Bernal Marin To: "K. Y. Srinivasan" , "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, devel@linuxdriverproject.org, Haiyang Zhang , Stephen Hemminger , "James E.J. Bottomley" Subject: [PATCH] scsi: storvsc: Prefer kcalloc over kzalloc with multiply Date: Thu, 16 Mar 2017 00:58:23 -0600 Message-Id: <20170316065823.13319-1-miguel.bernal.marin@linux.intel.com> X-Mailer: git-send-email 2.12.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/storvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 638e5f427c90..3d70d1cf49a3 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -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; -- 2.12.0