From patchwork Sat Feb 18 21:04:44 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: 9581291 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 A1ED4600F6 for ; Sat, 18 Feb 2017 21:11:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9224228745 for ; Sat, 18 Feb 2017 21:11:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8486C2877A; Sat, 18 Feb 2017 21:11:38 +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 350F328745 for ; Sat, 18 Feb 2017 21:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754330AbdBRVLg (ORCPT ); Sat, 18 Feb 2017 16:11:36 -0500 Received: from mout.web.de ([212.227.15.14]:49853 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753600AbdBRVLe (ORCPT ); Sat, 18 Feb 2017 16:11:34 -0500 Received: from [192.168.1.2] ([77.181.107.93]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LrHMi-1cDb6Y0XUa-0138uG; Sat, 18 Feb 2017 22:04:46 +0100 Subject: [PATCH 16/29] IB/mlx4: Improve another size determination in do_slave_init() 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: Date: Sat, 18 Feb 2017 22:04:44 +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:0pugRnHu/23yrQslIpJ4XpmooffPSIaOsjDSynL7mEsid0Lacb0 jwzkHnmeSCpSFDlMv+8KX16JV8giat0rI4aVwNMsKPyFF2ZxLrAj939/6ABXYenVTd10B6u mHbd7iWwAXn80ZovGBVC10SlQnyNetI5zYZc9ZIDaAOPC1bggrdLJvCwNkhIZDNMsxM5qb7 +/KpBTG3T0fE9/XDxm0oQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:NeS6uY28R2s=:xWmG+u4VvtNvwsDuF8biIa tzbt9eQ//5cIcsdOM99C7SBYRYuuQdNbmUKcRhW2/n2Mh5M9i1RAUOQMjZZvBjiMGgjaG4ey3 Hu1l1P/01IHLDcXdS5E4QGKsA9RJvKyJaDhI4M4Mr6UnMsE5xxta6whcS3+vkdl9qAhWOgd3f V54z/rklXI0iheW29IUrCDml/rxj8cISDcFWCV+Z4j20WfyaDofVOvdo9APspyt1aZEWVLQXa Y6q7F1lI3BWDFY566Op7pgaCq64HRpVsy/F+YmExE2xH3wqyKKtRHcN+NhERoEIFegyF4GJTO aswZ+qprs8On7WTLUMktR1vg7t4HCLggQngP4Bm/aO4D8lBcJVzy1VxkBTTKEk2rFU083NBdD jBr3RW7xvbOvCBtp4jmH1frOdFBICHMABz/Bc1LE1C2LHK/ZTI5qszEAP1uh8kjY7mkot3gA4 WG87U9fkJfubkv7e8K0LvztIslt23CN9bMHr1vwJ+R0czGsXNyqocD6DN4Poq9jntzWtnnDid MypX2cIaY6yts5GiYcPGb74vIOays4xDidrERP0cPm/GH3POFNRML8IsbhSo9mN00hS7vt3Ow KmzOPE0kBl0+8DUzzxwT7bFf9IGUmMlYSSVTR9AuRY9BM4iHAlFpptBsibufc/61nu0x9znjR HbMuld7p6FAcg7ipRwqCj25VkQf3gotZyUjmry0tb7GI03icVrHtAed7NBhK9b/lMU50Cpk5Q fE8/v/IOBOVr3biHvlLWyRzRZEkORuak+aBw29WEj/sloKGebfiW4yfFz2lRuOcSdBMRerwRr L1CHh3h 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: Sat, 18 Feb 2017 15:25:19 +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/mlx4/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index b2b472977a39..b78f17623121 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -3106,7 +3106,7 @@ static void do_slave_init(struct mlx4_ib_dev *ibdev, int slave, int do_init) return; for (i = 0; i < ports; i++) { - dm[i] = kmalloc(sizeof (struct mlx4_ib_demux_work), GFP_ATOMIC); + dm[i] = kmalloc(sizeof(*dm[i]), GFP_ATOMIC); if (!dm[i]) { while (--i >= 0) kfree(dm[i]);