From patchwork Sat Feb 18 20:50:20 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: 9581221 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 2E0ED6049F for ; Sat, 18 Feb 2017 20:50:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E78F28778 for ; Sat, 18 Feb 2017 20:50:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1306028780; Sat, 18 Feb 2017 20:50:35 +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 B480928778 for ; Sat, 18 Feb 2017 20:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753607AbdBRUud (ORCPT ); Sat, 18 Feb 2017 15:50:33 -0500 Received: from mout.web.de ([212.227.15.14]:59087 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753537AbdBRUuc (ORCPT ); Sat, 18 Feb 2017 15:50:32 -0500 Received: from [192.168.1.2] ([77.181.107.93]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lx7OL-1cH9hn1GiP-016fCn; Sat, 18 Feb 2017 21:50:22 +0100 Subject: [PATCH 03/29] IB/mlx4: Improve another size determination in mlx4_ib_alloc_demux_ctx() 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: <73833337-ea01-edcb-d9a7-85ac8a03c0c7@users.sourceforge.net> Date: Sat, 18 Feb 2017 21:50:20 +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:iL37jBwiwxPt08LumOrPajqYDNOha9DY09CUAnKbpsd788fQNVv x3d9eVvqmnxAZDG01W1Q2rP51Yzqsc3L5ap6QzfCxU+N4vZL8qPBVzF4mBJsRXPC6db1NBs XoXIAx+ozE/M1oCNJYrgF8mvOeiZjMqtlM8QiripbfEKL8m9x2IrGHd3zvTxuRvkfsFApY4 DqltBEAvWPgxhTcjCZhhw== X-UI-Out-Filterresults: notjunk:1; V01:K0:YzUWSciYjR8=:4cVUK8uSFdQyRJvXeK+2Oy UvHtsocu7ZoGDhxhBVdZwsJhcscN8R5I/Vya2VVrGVKRKCoDd/Hb2f3ETZpRVJ2ttJtUeI/XB Tg9AOcbtYGBt8+cKTpHQRDgbwhW1KW1vgjkiPMWShEUuIW1AFN7eVFbL9fmWD3yxh8VFeD0Ex 4NqguFROfyWPvRX6fBeZnyIJeu+xGZm7Psl1cQBTbbHmGv/DiEOuJ7r3K+6OWoZLgqKPM2GJX +Z8iK700SM1JmmHJE9xubpCZd0eR1OYkIX7XzpN1tCOrlQY1d7t9MozdaVYhR7F/PLrVihvCS mISzwWVawBeFcq/7KJhphYMDko5brD86GyzB0C8L0wdKhkRYT8wYHEy+SSm2b8bbDiE5z8h4P 9a0skNilgxiYxgI+QeEhU1uhSTKpAHdUSX15ZUiLPeakFEZ+g7WFOxfW3D8rQajPH3Et9rani VQ3Mevu9BV7mPKsDCaC9uFuh6Uvoi7htR2snt7n/fvVrYCfuLoTl/lyHtPE8ofh7AHKdwYd1d 2rS2dEh5pnBMPLWZl2jbhbsX8R+DK4rl4WE9G8S14BhAExy7a+cKc6NrdvovVS5fz6f6MhW6M qyWf6plND+SBba6KuIc7uQt3njWul1h3pPUk7PXs351JuTKlwhIuWb/fey2L2zKGBHmmRR7tl eE1NiEb3FHviedVxj/ahH2rPsm5FfNkddOyZkAYEQHisb4T3PWiFJmOH8mgRc51Dw4FQIIQ3J UbIXFgkLPQdJNLGMhN5LcBwXKjlKqJnV4e+YHB3wzCRXmcNtOvAe71b6KSGJU6znymVJ6KsiO 8umxbbz 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:15:02 +0100 Replace the specification of a data type 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 858da8746d49..284634d36b1c 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -2150,7 +2150,7 @@ static int mlx4_ib_alloc_demux_ctx(struct mlx4_ib_dev *dev, int i; ctx->tun = kcalloc(dev->dev->caps.sqp_demux, - sizeof (struct mlx4_ib_demux_pv_ctx *), GFP_KERNEL); + sizeof(*ctx->tun), GFP_KERNEL); if (!ctx->tun) return -ENOMEM;