From patchwork Thu Mar 16 06:58:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Bernal Marin X-Patchwork-Id: 9627419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B6E00604A9 for ; Thu, 16 Mar 2017 07:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8EE726E4F for ; Thu, 16 Mar 2017 07:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DB0827816; Thu, 16 Mar 2017 07:02:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C8A526E4F for ; Thu, 16 Mar 2017 07:02:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751130AbdCPHB7 (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 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489647718; x=1521183718; h=from:to:cc:subject:date:message-id; bh=YfOcL2pDY1os9QnSKDKK9PMm7B8VEh3rrvDUe9usmPo=; b=XL+PBOOwmcXsV0oS9NU1FP8sZcqmaizMvrhuTj43UrsZsBPHaqOrBIa1 v9mkVcq3e6aGmOA6eXpZhCPPvfVzUQ==; Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2017 23:58:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,170,1486454400"; d="scan'208";a="67886087" Received: from miguelinux-clr.zpn.intel.com ([10.219.128.51]) by orsmga004.jf.intel.com with ESMTP; 15 Mar 2017 23:58:31 -0700 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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: K. Y. Srinivasan --- 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;