From patchwork Wed Dec 20 19:26:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Tan X-Patchwork-Id: 10126439 X-Patchwork-Delegate: jgg@ziepe.ca 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 5A65260390 for ; Wed, 20 Dec 2017 19:26:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4859829629 for ; Wed, 20 Dec 2017 19:26:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A83F296DD; Wed, 20 Dec 2017 19:26:12 +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=ham 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 B0D4629629 for ; Wed, 20 Dec 2017 19:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755948AbdLTT0K (ORCPT ); Wed, 20 Dec 2017 14:26:10 -0500 Received: from mail-sn1nam02on0074.outbound.protection.outlook.com ([104.47.36.74]:43264 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755534AbdLTT0J (ORCPT ); Wed, 20 Dec 2017 14:26:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gU2cOIN9UKtpbjZZ7Ez7b3tI0IcyXn1el2iOSEjHUaE=; b=EYazyz2wjhkVG4JrMUrMWXHfjqX44ZyqYxrS94XisRA62mge3S5MVouKRpJSonuScDYuhdNYKvBK3x3z2YVdf6e/hALEtl8LKAPHC8LlbyQ1bpQDmCFIACE19pYIT1hzmCq1h6Vy2RxC86PkaGTztCwAoqQURMQTfVVs4iXF7Qc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=bryantan@vmware.com; Received: from bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com (208.91.1.34) by CY1PR05MB2778.namprd05.prod.outlook.com (10.167.18.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.3; Wed, 20 Dec 2017 19:26:07 +0000 Date: Wed, 20 Dec 2017 11:26:00 -0800 From: Bryan Tan To: linux-rdma@vger.kernel.org Subject: [PATCH for-next 2/4] RDMA/vmw_pvrdma: Use more specific sizeof in kcalloc Message-ID: <20171220192555.GA31203@bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171220192305.GA28403@bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: DM5PR13CA0028.namprd13.prod.outlook.com (10.168.240.142) To CY1PR05MB2778.namprd05.prod.outlook.com (10.167.18.24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2dea917-9847-4609-82b1-08d547df852c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:CY1PR05MB2778; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB2778; 3:9hDvJAI9OS4nyDZXDN+awVqqoy+8idyZbWpGi4YO/2yBn8sSShQgLFePtl9BnGg2ON+hDKJ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PM51Hp6eUG1OEkWT6b2WjeDzuFMdBRyrYgL7TAErpx2QeO7/Ss/TRvpjLjXI+h4TSU/qtfs6q7R8tGsGICp7uoWhFgUfgv06aQl/890KoONJ9lLdYphH9+3oJsiMzXDuu/Z1Anccn8OjVSPvZN+EYVS0B9/42WVkhU8nYzjIVMj1EkD9/vgDGumyOWE75ezUIgGTW4khbVf4/hSkGtVKyQCUgH3IP+cNOdxG+ziII2+OklKPM7jwZ9MCPqdslhiXRgwXJ8e4NPnQP2CLehxNCbeVYspo1ovcH9mQr; 4:opbUOe0m+zHRD2SSjKwKp2I8q9szJ3Jv2nBnAa0/ISUVnpM8pycz6zaIzpZjTY17msx57mZPwkt/xCOmDVHiwReu2Cf/OR92BYblnlJ+FT12xxut1+XgmDTpcG7z5314aJhxu8rketqjNRVxOyUT/ZKbdXYqCxSImNLbE8J0wR/fob3to3rlyZyvjPjL9ETlwT/ke55znjNcxvFeLy2Yn1eW7gRCP4JRAUtiaadax5TPXGt3+AXn7ccD7/r8kh7sV3655KCeEYm7scJJmpbLkg5AUJFc7VfzWU+jUSyX/fItjcLH67uRYPo1+cAtXGXc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(10201501046)(3002001)(6041268)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR05MB2778; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR05MB2778; X-Forefront-PRVS: 0527DFA348 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(39860400002)(346002)(39380400002)(189003)(199004)(66066001)(316002)(68736007)(58126008)(8676002)(33656002)(16526018)(16586007)(86362001)(2361001)(8936002)(47776003)(106356001)(25786009)(2351001)(105586002)(305945005)(7736002)(1076002)(52116002)(5660300001)(2906002)(23726003)(7696005)(6916009)(386003)(6116002)(478600001)(97736004)(55016002)(53936002)(83506002)(6666003)(2950100002)(81156014)(81166006)(59450400001)(50466002)(3846002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB2778; H:bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR05MB2778; 23:xhIasRE2BhfFw6LyUK4Ykp4EH//do7FdJTp1uLEGB?= =?us-ascii?Q?lOzMt2FVyYW0zj5x7hHbqWRWdL8PICq7ZQl+4S1cFZW98uTHBp+mymPcX9hu?= =?us-ascii?Q?cZKLV//RlRvkCoymVWyaVXy2FR1MmBjp7o2yOLb2/6unf1yMDyRM2hnY0xEB?= =?us-ascii?Q?Dw/F1KPjvi+BNSajcdVcpt9C3mlJCRWSQS6zwL3bSxdfGNni/4Rd3wiiiNpX?= =?us-ascii?Q?wPckFJWoY49fHN6eir9ocRie/uz1QT306eVkrxwQz/sNEXSJ3x+l2gOmy6SV?= =?us-ascii?Q?LVyuLx0uaBZAdJw/rixusUj5QMqWYCd0BgGNe0WZYTxQU3c8qBkQp96eDqeq?= =?us-ascii?Q?aAH/gE4RaFiu70KTOlyCu1j6rqcXOZ8oW0J+DQAIk46R00/P7oFAFmITc9uT?= =?us-ascii?Q?ZCHmvp/HodV5Ix4DQ4cCPlaNaPg/rzfV2glS+rNDCPPMIDszCHVKoF3NdQDI?= =?us-ascii?Q?OtFIPCQ3gxAuZ/SZlSw+LkNbkNSPbiwbPXWXDj3cvQdIhapzSDZqLQURbhlv?= =?us-ascii?Q?ntp53N8TQ+vUafadO1QYcS0Mul8rT/RHDs7aAuiFfEemgsZEPBCyNOE4R8tH?= =?us-ascii?Q?PgmjDkRl6Xrch2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Xt32g/Xsp7rBm1QoH1HymtmOirIK1qIKNGKj7vStTzN31S9Sc8mjgcvskD3AMFBDJK3oh7NZIEIJ9lLXfF/iNUkIhkWLBQpLjF4kLzp9Im+ARM5PEXkJsz6nwdGf/LaD1Qp6fXuS2hNZG67YShIqBjz9XM=; 24:4nA3mnrmvvEsfhM9mJYe4W8eNZu1Ova85TYurVWJN78eEWtcUFSo0C1hgBCmDiSzHZb+HGyemQh37c/dXtzMhZJR8RmpUR3HsxMmU9D3u/0=; 7:h7HVgrRQb4Iv20z1vLPLdF0JnOWcTdVJpxYGRKK0MjliK0kPbbzDEFQ/0Y4ZgnRqQm8TMHArtI2o4+OlhdYoDnwUXp0LKRe+MTMO2ET5BZb/QfuPEwm0kH+Q3WEgnm3//W/ZJCXNmeytnR9QYjE9agfdpaJhCbcrEtmsf4H7fmb5vlXmxeS5PPEZYTtZ7TB5X2bdr+t+S1e4X+/VBF633tGre4qCqVsVETDT+R/OzTVwwUEgiY00KChl2nT3u8b+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB2778; 20:uZiBOaDvhlLuKj/1zbzGPxoKeg5a6S/rWeIWKsMYRcwZ2uhy5oB8rxvHFQ+I1Y+JyxIcOU60QN8j5yIXeO57tE9ioAHJn+Ws8LwYKJTh+CMpLY3GXmR8Fl+qg+S9wC9EKwOUc0PCLXpp22i4YJA399YKIUH2WYMOFHMtbcM9Dn0= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 19:26:07.6609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2dea917-9847-4609-82b1-08d547df852c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB2778 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert the sizeof(void *) in two kcalloc calls to be more specific for the arrays that are being allocated. Reviewed-by: Adit Ranadive Reviewed-by: Aditya Sarwade Reviewed-by: Jorgen Hansen Signed-off-by: Bryan Tan --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index e926818..69835d1 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -243,13 +243,13 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) mutex_init(&dev->port_mutex); spin_lock_init(&dev->desc_lock); - dev->cq_tbl = kcalloc(dev->dsr->caps.max_cq, sizeof(void *), + dev->cq_tbl = kcalloc(dev->dsr->caps.max_cq, sizeof(struct pvrdma_cq *), GFP_KERNEL); if (!dev->cq_tbl) return ret; spin_lock_init(&dev->cq_tbl_lock); - dev->qp_tbl = kcalloc(dev->dsr->caps.max_qp, sizeof(void *), + dev->qp_tbl = kcalloc(dev->dsr->caps.max_qp, sizeof(struct pvrdma_qp *), GFP_KERNEL); if (!dev->qp_tbl) goto err_cq_free;