Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbdCHNV3 (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 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1023 Lines: 27 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 --- 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; -- 2.12.0