From patchwork Sat Feb 18 20:49:01 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: 9581217 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 86E7E6049F for ; Sat, 18 Feb 2017 20:49:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B9728774 for ; Sat, 18 Feb 2017 20:49:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C37E28778; Sat, 18 Feb 2017 20:49:48 +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 10C8D28774 for ; Sat, 18 Feb 2017 20:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753869AbdBRUtq (ORCPT ); Sat, 18 Feb 2017 15:49:46 -0500 Received: from mout.web.de ([212.227.15.3]:57045 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753607AbdBRUtp (ORCPT ); Sat, 18 Feb 2017 15:49:45 -0500 Received: from [192.168.1.2] ([77.181.107.93]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MQt6E-1cnUCv1p2k-00UMIr; Sat, 18 Feb 2017 21:49:03 +0100 Subject: [PATCH 02/29] IB/mlx4: Improve another size determination in mlx4_ib_alloc_pv_bufs() 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: <14b2089f-f52c-0b18-90d5-810abc9f9fd6@users.sourceforge.net> Date: Sat, 18 Feb 2017 21:49:01 +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:vVaHuWlGoiQieXL7D3+vy2mbMuFM9cgFuwvdC6hadG4TjnxQ/5z 1WzWEf4blhfhQwUXIBQoZQ5iF5WRaTtZ6v6TwXZ+V3C5E6hab+jxXmreN7L8kX6ZHPqByLV oyA7fX4S8UXN8kScxhs48NtBiAfWq3GFsrcUFD7h6YturWif1/lansLtbfwZH/WlQVZT5uT tWincyy4mBAnhbqPfNU3g== X-UI-Out-Filterresults: notjunk:1; V01:K0:hdymRq+zPXY=:8oAwN+OzcQxpDwXaQudZT8 LZUHn9t0bBvdcgc2dLezNqgH0qOP93W66vA/AU2YLm4Yb1bFLD4/+oVgppANWnkZpS5gRG06z /3Qk5KsmhjSxipZbGxY6YSgaM0/5MEupDj45+iIwfO/fy7cCKI1NaIpEggXVQTC+ktbBBGCOf mPALTeiYmikN5EaYrPwCTPmYyXwZ1ST/kvJUWMKH6BxRNbN8ppEU9/oZba7odobxKCrsI6bcs PxJE0iSVcNb3XkvTPTiiVwVFBR8VXOVoakAK4c1AkyxTL14lbqAVUtfysBFxxlXxDLEuGAyTQ GV2heA8yfougvg6YkP+UQ+0wtOLmislnC2hNJfkm0rJ9PZW1+j8eSrQdtbOWwvZsnuNrTCmaW 9G5SmIlqGpTVigOR9HBe+r/Ua24+A6Y8A2NQp8MxsOgYwLQOOhncNpiTGKn0l0kVOu9/t7NkL niDugetoom7ZWmimRzc5iJ699ND/JMY2neLSWGNR9Pi75O8TKA/QHyjUzuM8ohSLofDjWIh44 8kuC1aR6RZuYtOV7UtpL8spjzcD/CqDYID1FFPgr9+2GSUglr18Zm54ZEdmNKIFhnUYogS23n dffpnL+0MPbHSHGJsMmJ3ACi5gu6KHxe9PeIgqm0p7Po8Mhwhpnf7QXy6Ilo2tBvi11wA2TL2 aBF+pdcAyLXjCcfshF5Tdf4w5nPYkbmOVbcCCMOXaXtupYzNysCS1Yisq0TjEo9j8NO2j1r9V bbbNJS2PmOXLK6B8xuhgaQvIHF9pVekeoc34yHJPqPoR4USB8ujs8XWhGekIX+TjI7OJXZImP 3J5WgLV 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:05:38 +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 61bd81baeb29..858da8746d49 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -1607,7 +1607,7 @@ static int mlx4_ib_alloc_pv_bufs(struct mlx4_ib_demux_pv_ctx *ctx, return -ENOMEM; tun_qp->tx_ring = kcalloc(MLX4_NUM_TUNNEL_BUFS, - sizeof (struct mlx4_ib_tun_tx_buf), + sizeof(*tun_qp->tx_ring), GFP_KERNEL); if (!tun_qp->tx_ring) { kfree(tun_qp->ring);