From patchwork Wed Mar 8 13:10:33 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: 9611151 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 562C560414 for ; Wed, 8 Mar 2017 13:44:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0058F28592 for ; Wed, 8 Mar 2017 13:44:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E929D28595; Wed, 8 Mar 2017 13:44:11 +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 9B0F228592 for ; Wed, 8 Mar 2017 13:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbdCHNoK (ORCPT ); Wed, 8 Mar 2017 08:44:10 -0500 Received: from mout.web.de ([212.227.15.14]:53972 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799AbdCHNoI (ORCPT ); Wed, 8 Mar 2017 08:44:08 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M8c2V-1c0Fdh07iF-00wFRi; Wed, 08 Mar 2017 14:10:34 +0100 Subject: [PATCH 14/26] IB/ocrdma: Improve another size determination in ocrdma_add() 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: <97417c29-a9d0-d30b-952a-3b3325a52bcf@users.sourceforge.net> Date: Wed, 8 Mar 2017 14:10:33 +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:r4SdQOZapdBHb06dEOdY2Gx6C88vVtkQ5BXb1RHTcaHIsDS6zVv /oJG+PNjrMtaR5bxaxGDlDR7aJUpJLa4ig57q/umhmzUB6Jwf5pCD1D8DrATOuIiB7lyzgU 38+vCFyiYHSdVJP+/OQzDq4+QOhi12nkUB8u87biBolR901PQF79/8ebJ3P/LlsCRadYk+b i7lKQAesM1PYPAxVpTLwQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:nL9PJgO8EQI=:iRbR8DzRUeRleHJ7RS3b6f DlaOzGMIu1Du64VYvqYhr0Ke+W258hbQwMH5nHScd5GLcY/rqSs/Y2cZ2jC/HJViWAXRotDiB PBKV3AnzQ7/cWUuebXBEEZ2gECptZEpHSv6DmGqEejmG0QKLuk4263L/+KRsP0y/QEzhKBiO9 XByYcz8TMRHXuOuKelf9eTQqktPwfvlTkjvbzuttmMwHF57HHdlvpjnrk19gPuukszQ2XzXnA C/Qk8eOYJDSzHXfzBLmaq7vZTTmMW0W3D+gxNyd2pc+fMImUwy8McZTtZCEd9EHeXpLROwTCZ rv1q9cx0EEevQIX4pg5lzmyGeyyiQT9R7Qf1tJns07uqJFO38hNyV0fM6DvRmkh6fxofWKYj1 EeTMrINmrqXZdhBtZG6NT4w+HiRwNez1om4m2bCaMvVNBpFtek8pwBW5ZnikpRJTvJt2zwVNY J5LnlcvwABvhkzglSPq6sEeCGFMfXh4DKXdUs6nPmpImESt9wVkFljtLGj1+gJR5uQQDJc75g xPfIStzAueGRGTtZbqGkyUzPEIsELSUjYVMbGrdBWzX7is32VpZVk7GD1rHBSoXePioXgDvcC m8dmvxwgRRpgW6RZcou8zoNu1njJ+weNOv2L7MjmTv2WUWcNj2N/RtEmDRzT68YZv5VBUKggi eyCWhJB+FKIjZVKd3WRJnTgLcnSnd68pbKaRbGtM6pQhM9eUcIs3Sfmh/tZowGzcGnJEOEBuN SWdpUwzeAElHMpj7JrSUslAc8bf043ZoEQhh2Zx+O+Ag9W69dpBIzc5kfSF0ZMVWmDfZtPOCs ek5g+pb 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: Tue, 7 Mar 2017 22:12:36 +0100 Replace the specification of a data structure 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 Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 9caa4c564e34..c49b4491d4e7 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -303,7 +303,7 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) u8 lstate = 0; struct ocrdma_dev *dev; - dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(struct ocrdma_dev)); + dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(*dev)); if (!dev) { pr_err("Unable to allocate ib device\n"); return NULL;