From patchwork Sat Feb 18 20:51:43 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: 9581227 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 8AB336049F for ; Sat, 18 Feb 2017 20:52:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A39C206AC for ; Sat, 18 Feb 2017 20:52:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ED4B27165; Sat, 18 Feb 2017 20:52: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 28D86206AC for ; Sat, 18 Feb 2017 20:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754211AbdBRUv6 (ORCPT ); Sat, 18 Feb 2017 15:51:58 -0500 Received: from mout.web.de ([212.227.15.14]:59561 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754067AbdBRUv5 (ORCPT ); Sat, 18 Feb 2017 15:51:57 -0500 Received: from [192.168.1.2] ([77.181.107.93]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LmuMO-1c99UU1i84-00h34i; Sat, 18 Feb 2017 21:51:46 +0100 Subject: [PATCH 04/29] IB/mlx4: Improve another size determination in alloc_pv_object() To: linux-rdma@vger.kernel.org, Doug Ledford , Hal Rosenstock , Leon Romanovsky , Matan Barak , Sean Hefty , Yishai Hadas References: <1935365a-bd7c-461e-6a84-0c5d3a501fff@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <398511b4-2e62-ee7e-69b7-f9a83922332b@users.sourceforge.net> Date: Sat, 18 Feb 2017 21:51:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1935365a-bd7c-461e-6a84-0c5d3a501fff@users.sourceforge.net> X-Provags-ID: V03:K0:XI72MfvkMf/My1Byk94VJtgL6tGoQmTVRqMDqXSVUKvPE2z9NtJ E/kNaLBUCiZ/lH52rI2R/HCp6/BieT2KasF5lTDAnrb06gWJXTWI21Ce3W8PFMsGz7ChaCE OcNHooyVaOAtATJ9eKS66nEzCg3N7FPJmPboVfM4Y/GdoLUIC0zccqUPUKV6D7A+kb5ZsG8 wZaLspT6+R4C9NTYxujWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:0vaT5y1rLvk=:C6BpiSD6AuVyhZmjUuToNL 18ZOU6bue6q0rMKlynl6EmbFsN552X8hMsLAHK2JJMQFHdaOWMnth7t2sCt6njcqtNr2HQhL5 DgbGqeRc5j1hxFLZ90RU7IrWh4qFfd7koU9t+7m6AbV/iSJqVeB6pOgqiBBExHnI4B3bssLQs hdGESAWmbPsh1kQZo164Yko85Od4FuDhOwV8IaZwvXwnYPJapOAv0TSFVnnGISmi6PArR+Q9h L0xwk84qoe4Caui7vxcUuDRDm4ZK3EgOYke+Cxdwo4lXJTNTWIzby1S2QTxCvVLUKy98QSwlC zWjDbH++V8sPOX5iNAe5ho7bK7DWPQSSwRT/nLx/IyB4zziSnzYgIgXQyR/BzSShXZToxLEOy +X2oxwiBAKrE8WCtUh1HiC2BsN7Rp5zCM+1yqV4bu97ARp7WlwvSAEPr/9BCmU1ZRfsH7ADFJ Yg6Kk5QCOPN0XCxN6lr2AAOdwWPCr5hV6OEuAm/VaqV3CjYoDShD5u0qEyV17YjXKoAfFcnry q/8Yxw/T22KRZ0BGyL9hzSzLDma3APnYqBjsB1qKvZkHF5+ZQh1SOFVEqIzml6uOhwRXfPudL W/INvGhf/yJXbf3VrzGWiPSctOnj+14GtfDK2Ej6bm6wzVM5ZwfUJn8t6/wt9THjyJHdfmdMe sQRjONdrX6EH2CkDr7r6/ODDv8Np0ScuaF7Eninp+NzV2rbdyaixpZn1ztUCWTWgQZhdeXaTh 4pYc+FU10Ocdkv3GSRywjGOdvvWCW0xl0gqOvx8CrzA8v9X+Rx9nc9s6DpssqMOrEQ1G+1eHt NrzVrtJ 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: Fri, 17 Feb 2017 20:20:43 +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: Majd Dibbiny --- drivers/infiniband/hw/mlx4/mad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 284634d36b1c..ea4892b0f39e 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -1948,7 +1948,7 @@ static int alloc_pv_object(struct mlx4_ib_dev *dev, int slave, int port, struct mlx4_ib_demux_pv_ctx *ctx; *ret_ctx = NULL; - ctx = kzalloc(sizeof (struct mlx4_ib_demux_pv_ctx), GFP_KERNEL); + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM;