From patchwork Thu Dec 14 00:22:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Tan X-Patchwork-Id: 10111255 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 3389660327 for ; Thu, 14 Dec 2017 00:22:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23ABA27EED for ; Thu, 14 Dec 2017 00:22:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1708128449; Thu, 14 Dec 2017 00:22:44 +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 EF4FB27EED for ; Thu, 14 Dec 2017 00:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751026AbdLNAWm (ORCPT ); Wed, 13 Dec 2017 19:22:42 -0500 Received: from mail-dm3nam03on0061.outbound.protection.outlook.com ([104.47.41.61]:21504 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750795AbdLNAWl (ORCPT ); Wed, 13 Dec 2017 19:22:41 -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=hRHac1UFOmM4EqZzU1xf6zIIP/O2hqCaoRuargxVdN8=; b=K5yPN1oE5b+PrNj5qJYdEEEF1+P+VDuPVRDN2PGWnjoEe71Jn+sBHzIUl1E5QlecIwDW0+VI7KyOT4pNq2ifDN+oQZeWmVMfzzPvkd5Gc84PeG0v7rUHyPJn2tgcl4Xiiyr4eOMd+VQoKajcERE4VarYqccORtax95/RLomHoEY= 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 CO2PR05MB2774.namprd05.prod.outlook.com (10.166.200.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.2; Thu, 14 Dec 2017 00:22:38 +0000 Date: Wed, 13 Dec 2017 16:22:20 -0800 From: Bryan Tan To: linux-rdma@vger.kernel.org Subject: [PATCH v1 for-rc 3/8] RDMA/vmw_pvrdma: Use more specific sizeof in kcalloc Message-ID: <20171214002208.GA14215@bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171214001753.GA9780@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: VI1PR07CA0127.eurprd07.prod.outlook.com (10.170.235.14) To CO2PR05MB2774.namprd05.prod.outlook.com (10.166.200.26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33d42129-d7de-4051-389c-08d54288c8e2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CO2PR05MB2774; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2774; 3:4/CBkDSntH6OlNfCUP0weKbcpnejKNzY4ln4/BTkOchc+vsrMgEKlOB4Z3czLpnfGJjFcSVcHmSF51EwPs0r1dN6Cr3Gj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05dwlhywsrxAkBN6gQGMZ8fW+YJUT8rA/fBuKgw9MbzwEc5UziZ20ZWErjaGRaTNcQGE7nfKX+s8gR35o6MPoQF+bYAwpVV82uj87F1onNyep1VsDFpPQvJBE5kaARlvXNQbb9TciF08o66VV16gs7oSIEPQR1NByjmnWmwK3leH2IjABT89ZulKnqeMF+zZ/A/lSwtVTlmbll5K1l0M+EK9sGxPNTDpfKCTKhnImBka3lwKxS371Zx7YrQIzi+rmzdSx93kWexc; 4:ZXzoOZGMssDEekXzNtuoUVWi4xoAGueHd3J9UB/0toX72s4bGy2gmAEOqIhXZahYwUdW3KqeWpK/ZW5z1jHfDBx5ocnUE72Qy39Of6IZl2Yo8uDaSqluGRU77sz/T0hFIXcFRffiFyWuiHO+M6ywwfzp58MFH/ai5kR/xzaDoIvx2snyjBCORyG6bxGPbzQc4OHHHjSjAI4szcaIza7jYItaLbT2W8MQBbwMIiecLa/kx3r0Hu6nJNMxQvnT8ULCYwPrkylcj/P3NHWC3qoaNYNUjE2IGMG5pHgqcEUqPaMdwKpbD7cgyNztoHgNcpNv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231023)(93006095)(93001095)(6041248)(20161123555025)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CO2PR05MB2774; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CO2PR05MB2774; X-Forefront-PRVS: 05214FD68E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(376002)(346002)(366004)(189003)(199004)(105586002)(86362001)(5660300001)(2906002)(6666003)(6916009)(2950100002)(66066001)(2361001)(33656002)(2351001)(47776003)(50466002)(55016002)(106356001)(6116002)(97736004)(23726003)(3846002)(7696005)(53936002)(8676002)(478600001)(305945005)(8936002)(25786009)(68736007)(52116002)(7736002)(81156014)(81166006)(59450400001)(386003)(58126008)(16526018)(316002)(1076002)(16586007)(83506002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR05MB2774; 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; CO2PR05MB2774; 23:8+FfYNMeXky+ldwnJgBdAYr5LgPUaU9i930QOGPGw?= =?us-ascii?Q?bS1PYwkEV5cwrhBRmOVF+IAJMAzglm/mwJhiv2jGtfB7p1dwyLWdlBowoxZO?= =?us-ascii?Q?xnO4viRrBUj9kTI+HQ1tdFBUtJvlIWnIW5sYOC4nO3oBTyOubqm4YwrF3dys?= =?us-ascii?Q?muEcwavGRi6e5BKfMpgAUMyRfaZL0mUrJFCIR3xEUfXuzkHi4UmfAXpXX/s7?= =?us-ascii?Q?qZJjRTEwCoKkfW63qislIGxckxpmrLqGY6K1Kxb/YdiUFba6xxBrgGW1Ki3A?= =?us-ascii?Q?8/ayg+3myST4FsBPBi9I+FTChTKHlE0sG/dy1/KyICM/3xw2txUuDMc7ds2z?= =?us-ascii?Q?tc0Gg5lHfB3jGs21haB+K2B/eq08CC1uyVjQFw9hNMrvTyTjutRQJGr1zbe4?= =?us-ascii?Q?atJm6aJWy5tMyVMhVyMB4uUw2TR0u2A8xF3P715ivUgwulnG+E/FBRwKhz66?= =?us-ascii?Q?+sIGjgMvoSZols1tTxehtaRTvj9kVDG5WEpbzqUWI3Cw8akaPPQhTmO13Iwv?= =?us-ascii?Q?EsMOOUMnJA76u2zl1H6OINXkY+2PZl7MplTmfNMac/Vw7t7N1M/uhQmJ79IR?= =?us-ascii?Q?rQHMNC5WS6Q65RFFMMgx5QrrsFZ9qD7cN2DIETWqOMAOnoesWEoWOSFKzvrx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YHouv3njLdQFEObVFTcz8aq1EUnaxgTlc9TSsebm6yRuQK77/nPrQLJoq0x6Q7xYoDpTntNfRS/8sGs/M0oK2FV61keJRC2ijVLw=; 24:P0N/3HT82n9vySW1DUOP9pcFrRrTaHOiv5l+lZcgiKckCXjuedLxPk6ujjVvhYVdK01amQYn4RrWHzNU2bkaGJNS1/q6pZHaOgKr5uUCNJk=; 7:EgZredb629PUVNc4auBPmWA7ztlaaJFp2OBfIxpO6qN0pcUkHzjFefna4wJG+rZVC7TjgmLKIy7+qtR6hvNRMBqplGSHCkwhbTCOmFScDozhGv7xLIoEKjhxk+SmkXiLrZvevLPo/u4lT30Si6KWd14a00E67qMblyGuoGXi85aaa8JjxHaRbhVDsiL6VQVoYvcJSKTXoNYGcq48qRcEyIABNT4zWlPgIAYYi5ORgU4bkUZFK1YPnUScAaRw3Wlp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2774; 20:lVq1Jh3l5yhKvIDCkNbUVkZQviV44jia1FUFpBr8xzddOXHA8LsfPeSMk9/pfd8MOfwKfJkrJ5nGCGaY99mJ2I7duhepyHe4QIFpBBa8mEuDMdYuXpm7lQ5yYTdSKXaBDIaSQfPrcfEN2SODjc51eSHN92mFLumiJ05i3dBMbmg= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2017 00:22:38.1203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33d42129-d7de-4051-389c-08d54288c8e2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB2774 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 1f4e187..941e324 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;