From patchwork Fri Dec 8 19:01:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Tan X-Patchwork-Id: 10103183 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 57E4160325 for ; Fri, 8 Dec 2017 19:02:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45CEC28EAF for ; Fri, 8 Dec 2017 19:02:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A5DB28EB9; Fri, 8 Dec 2017 19:02:14 +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 B278428EAF for ; Fri, 8 Dec 2017 19:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752375AbdLHTCM (ORCPT ); Fri, 8 Dec 2017 14:02:12 -0500 Received: from mail-dm3nam03on0049.outbound.protection.outlook.com ([104.47.41.49]:63010 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751268AbdLHTCM (ORCPT ); Fri, 8 Dec 2017 14:02:12 -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=CeePRucaVyIQSb1bpUMbIsf/EUGxDY/DY5mYtLFwJwmxx/8h0pP3i+CJYNyrMgUq5LSL5aSyeD4D/EjmaxbXG/kmwFF/aaNK1UN4VsPM154hZ9WukCLKF5r3iDNnkRgww08m2BZSvBq+v6gTWLJLF2q9Jv3ZO6s4iPNm7jc7XQo= 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 CY1PR05MB2777.namprd05.prod.outlook.com (10.167.18.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.3; Fri, 8 Dec 2017 19:02:09 +0000 Date: Fri, 8 Dec 2017 11:01:56 -0800 From: Bryan Tan To: linux-rdma@vger.kernel.org Subject: [PATCH for-rc 3/6] RDMA/vmw_pvrdma: Use more specific sizeof in kcalloc Message-ID: <20171208190149.GA32730@bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171208185818.GA28514@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: DM5PR2001CA0013.namprd20.prod.outlook.com (10.172.43.23) To CY1PR05MB2777.namprd05.prod.outlook.com (10.167.18.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa1da653-b40b-47ed-0bdf-08d53e6e2f3b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:CY1PR05MB2777; X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB2777; 3:OnhaSJPA/FDdg0Uy7wKrbVu2XLGJyGCQt7EJepKWF4uJoPmrvv0sP0jTrlsBEJCnVfmdZMyolrAllg4s8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uWNigD6mlAPrwZSEddo/HtA/nhCRP3NqAGCRPdUgtIIzl94NdaMIDekHLx9yNgODM9aksPUhSqod87snJ+4Kom6QYvJ2jIjms+CEXYfYXqJp3D44n1b/zBHOqnbRM8yIiQTT42daAX2WHiFTp0xHa83xWdpLa9IPplWSTJ4rMNFPsbskS4/fgsI9sQS7xJqVBwv6tkOQragYYxlSIjHj3QszBnM5WCb1pXQY9j4givPXELmY8/fxcA2CygbNBq9Co8kFfux/jHJk5b+n6af1bk; 4:HGbDeqFuCfCf/T6RQBzk2/SxsO2mxBqYIQN1BIeJjWfUIFkgUU2cXZ4/c8JLYWFw5EJhWVcJUfATjtMCrTy+jmgh9reA3bEBK+5UVVUL0OSjQyU4wISCX2sqDReE7HjF9sW14hWp0doeXrX3LnsgMYN7LUcxyKjkUmvGdXfC2Es/fgeCUAngO5nUY9AZUH1AnhWbc8YqtQRtf9idqWujLFauHqEeHUoQL3xPx+ezb5swICY6CHD5OS2zX9b7Wdt6Tq6/+rJHz2+KF4xyeckdeUF0xPoLHw9Z/z3ppPcO4CC8ZjRCVpKf8JOpopOxUzst X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231022)(6041248)(20161123558100)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011); SRVR:CY1PR05MB2777; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR05MB2777; X-Forefront-PRVS: 0515208626 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(199004)(189003)(55016002)(105586002)(7736002)(33656002)(3846002)(2906002)(316002)(16526018)(66066001)(305945005)(7696005)(52116002)(83506002)(97736004)(25786009)(8676002)(8936002)(478600001)(53936002)(5660300001)(68736007)(1076002)(2351001)(58126008)(16586007)(47776003)(6116002)(106356001)(6666003)(86362001)(23726003)(50466002)(2950100002)(6916009)(81156014)(81166006)(2361001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR05MB2777; H:bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; CY1PR05MB2777; 23:szy+Wnng1tIqdRe75sOr6psosPPz6PXE5WdqoE65S?= =?us-ascii?Q?aBUs162TeBzn4w/Rmp4Uev8MPYm/9LTt9yXAf3sPClWsKai4+cnf1etU+mtX?= =?us-ascii?Q?BvePDFKLE6XH7rRL1NGvAJH2fo5TkHcK6v9atC/9oHVyAyEg9QRNPzVIzVbf?= =?us-ascii?Q?rrERfP0/vN6nTWHhgzimJG1XE/bYWnWkNaBDa7TuYrqokdYImPYKMNbMXdOB?= =?us-ascii?Q?Q7mLN24x8q9+jkPa1lmL2XbVgPblMr0ONsvCCtn1Akxrlr6XlTotaTzJIkKL?= =?us-ascii?Q?l4N/3kWx0foauZREl1tVZGEaArZSxN8ddmh0TxZce75J19aQObp3/AyCpip1?= =?us-ascii?Q?L3FieJQXNzZc55IEbIBJ8YXG2vHTASdsq/eCXwHbbIhNf9Y7cBeJsKjm02Qt?= =?us-ascii?Q?DpZPnWUpG5fReu5v2Akom0XHbPAkSwu7Fd2VSxif2sKoPQXTlqmJnfpjSwWL?= =?us-ascii?Q?2fTnbOk7HmRWTwXqqbYCxrrpP3tKl8f1xtnXvC4c3oMhlJZZTO3Ldrkl0oQq?= =?us-ascii?Q?Kr+eZjXuNSBsWbhJzuKgJmOJXih8c6n67NkqB4cuzD3Bid1epblkCuqBffYy?= =?us-ascii?Q?qh8YcDOFQfGhIxH0AJBoEwxkf0PFKB8wSEoFCX8MKw+cNxdhQAVct+elwxEG?= =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bdrnq70=; 24:fKTGtFmn7uuHb94HEZHZ48CvII/L58JobC0dwBV3WNeyUEASEhG8fnJ58d3wOxWJ1Fv6pjmiS7BT5jtM1Gzw4GQZOGerWDu9HQ+gwYkqzNc=; 7:pYsDMHTrzkC6/1U3ASeoGWoOZL7BtuxXdeuHg6+E9qR34duJpvgQsfe9r3WPWWz3pE9JZOa+Ti0BR00zO9G7RQKeuWoSJptDAcAtpaKd1+hH+K0cWt5YBXHGnYgUIHLQvQeDtDilxWUtYZW5fh7XGW60yyPV07/sFeDgQJKheD5mN63Nrzv8HAb2ubUtQMboSCMW3WSLPguszmHrlzHh7aKYKHGDL/5oJ1DLK6iGfYgX3lfbc2WI8twqrcE0n3WJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR05MB2777; 20:LKIZw6diUSiTBz3tVf3g2vnN/iQ3lbEcCAbu+49Z0ayM9hyPnh/ciKaeBnT5/XDkz+9E0gNenjYZriREjcOaRA545TWnumi+Z5uo/Avn38AbNRQshBMk2n54ZiTN0hXAK0GbphDKG2BRDGjy/Q1YhPK3Lh5hAs9mMQO8aUwnVEM= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 19:02:09.8610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa1da653-b40b-47ed-0bdf-08d53e6e2f3b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR05MB2777 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;