From patchwork Wed Mar 8 13:20:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9611053 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 71DF16016C for ; Wed, 8 Mar 2017 13:21:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 913202793B for ; Wed, 8 Mar 2017 13:21:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 838282858D; Wed, 8 Mar 2017 13:21:30 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 2DD932793B for ; Wed, 8 Mar 2017 13:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbdCHNV3 (ORCPT ); Wed, 8 Mar 2017 08:21:29 -0500 Received: from mout.web.de ([212.227.15.4]:51271 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753373AbdCHNVQ (ORCPT ); Wed, 8 Mar 2017 08:21:16 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LmcRH-1cDN1z15tb-00aEvD; Wed, 08 Mar 2017 14:20:44 +0100 Subject: [PATCH 19/26] IB/ocrdma: Improve another size determination in ocrdma_alloc_mr() To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Wed, 8 Mar 2017 14:20:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:DKFvO5unqKcxL7F2zY8C/Z7QFBx49qAbKvJ2W1VPuh1QRbiHfGK qnIqzUn6Rw13BBe0qTBaJmTzLYnilSpuhM58jJI6e8qWTSlRfzd+Lxv5YoSaH6Du0RnDs2F /YiVr229Fb9x+BzkUCHvgwA1k8ha3CL1FRCVIbh7t+hR/Knb/pMG06Pl6rK4f1VNByz/b33 kEG46R35cTdRh/eXRRu8A== X-UI-Out-Filterresults: notjunk:1; V01:K0:bS2Rgbd4zrc=:YHnpYT52wmho+xrq+II5cw cVwH9m1Zvh9dlz9cN7OcOyz48Pb402nt2VHU1fDmZDksQNCwvlTzTY6ddawCPSvHgto1KU+9k Z8p7CHRt5oSBYUo5GCpo8d14+gPmqBPUU9+hKONFxQ3uA3qmMIpPBOcxgkJMkQCRr2wG3jwo2 zcAUhvIyS7o4u59XZMciteBTmBwNusMg1dxQziaLD0Sj98OMspWbRSQf7IzNEmAYgQI00qR90 XMhZVJL+ldeYG5NiiOi/ZnB787h9GJ+XZCS6F8vNzCFbU4wEyGujomKN0E1rAoDiplafX9PyX RKNajmnJ2N84IiexY7Km3FHa22uxk6AlTcbrZEQvT2qNYirUb9SUvXdGdV9VlufOfAqt6jonp BIiBn0upvndZI6lWzjS4NpaNDbWmwwsYV7zGA5sDQdgVP3jFnyATe8/RDvvyRExfQN0MPdOUq kajkjrxCS9StolT7auA2m+vEyomErfN6sW7RBw8t5KMbTOIOzGXVQl72JneGIMP7R4UQItlVj ZQHQy503/LrkBGxj5w6P113uyjCkbaqpbR7hVmWsBfEMHyOgVYn/N7ZUajfpROEPNCos5GoA8 tXSbI/tTIctEbpCQGQJitEINwwGn5j6GxHEZ68ZsIAV1weuYJr49ADKZZAdxlfxXldseth3e1 rqxbmySRAEOvJFqpyDFwMFvju6kn8lwg2BobpysZ0wPGenXr08ipXgUSiY1rRExFBGjhn9FHk i9MyI5Q52BrAT+IMH9lZ0vWiIoZGZ/LW0+zXVyEGiftHxdSY1uUPcBjUK7CpRxDmQVT7POIrS NL67SSB 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 From: Markus Elfring Date: Wed, 8 Mar 2017 09:54:42 +0100 Replace the specification of a data type by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring Acked-By: Devesh Sharma Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 330617e1ef75..05d55d361cfe 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -3030,7 +3030,7 @@ struct ib_mr *ocrdma_alloc_mr(struct ib_pd *ibpd, if (!mr) return ERR_PTR(-ENOMEM); - mr->pages = kcalloc(max_num_sg, sizeof(u64), GFP_KERNEL); + mr->pages = kcalloc(max_num_sg, sizeof(*mr->pages), GFP_KERNEL); if (!mr->pages) { status = -ENOMEM; goto pl_err;