Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbdCHNoL (ORCPT ); Wed, 8 Mar 2017 08:44:11 -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 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1066 Lines: 27 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 --- 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; -- 2.12.0