From patchwork Fri Apr 7 21:09:08 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: 9670447 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 5F293602B3 for ; Fri, 7 Apr 2017 21:09:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 513952865D for ; Fri, 7 Apr 2017 21:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4575828665; Fri, 7 Apr 2017 21:09:36 +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 D07782865D for ; Fri, 7 Apr 2017 21:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756448AbdDGVJf (ORCPT ); Fri, 7 Apr 2017 17:09:35 -0400 Received: from mout.web.de ([212.227.17.12]:54939 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756332AbdDGVJd (ORCPT ); Fri, 7 Apr 2017 17:09:33 -0400 Received: from [192.168.1.2] ([77.181.117.94]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Mf0pJ-1clEB4011N-00ObMs; Fri, 07 Apr 2017 23:09:11 +0200 Subject: [PATCH 9/9] IB/isert: Improve size determinations in three functions From: SF Markus Elfring To: linux-rdma@vger.kernel.org, target-devel@vger.kernel.org, David Ahern , Doug Ledford , Erez Shitrit , Feras Daoud , Hal Rosenstock , Leon Romanovsky , Mark Bloch , Or Gerlitz , Paolo Abeni , Roi Dayan , Sagi Grimberg , Sean Hefty , Yuval Shaia , Zhu Yanjun Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Fri, 7 Apr 2017 23:09:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:T9UhBN4TXEUw0fy4RtxfbYoQWLfXPwoz1TVOE5FfnzcxfQk14W9 HK8qMJfUIBAFb/Tfm5H3YHH2yp7PddnqSA0MfewRZ196hcDSujsresA6zF1tG+QnealDc9c dt8S21wjWAxir9KXtfMmi40kOMP+XTLEzWUI5unFVp9CF4oH3bEkZrKo+orLx5IVeLDjOXC nf3PWN96EK7hoIl+uYYLw== X-UI-Out-Filterresults: notjunk:1; V01:K0:MeQx0ur8DeA=:wACUP5/tySMPurtCFNGia3 1l/xPb6LD66jc4DUkFcuIgtbD8ZCKOXA1UTzquQLltxXVdLaj4YpwSHCdAWqGJbC3jWOBSvS7 swypgaCcB9XpbgZuLV8NCPQ4HA23wDDy2x/N5SDb5Xy/J1RKin+qKbtqWr+OFK00EblpGYNk0 atszRjB/JHdY2vVgZElbu7NCsch2y3ElqYehQUqjAl9aLRBHGFAuIDgZr5t/TXOil6FCcFjVk 6vV+aMvMjJZC6LRtDDVuTv1M/4HSn6zB8iatZi2QTuQ4Uv+goxlcPl0Vyj6ADc13gkTm4gS0u njOi/DQEade+FwuDGRadOKPEPzquQFUCOxYp5LTObY5j8+Uj+K7/08BO1eCPP8xkuLbGLoyeZ duj3yhQxykrPiE1vxSUH9s0KdBD92hjfxIck2tD3lS4n6z3QvCLvJ0el/05Ffp6SC/fMezePn YaYww/CJQNzgMA0TsBQEOhkvo6EjL0BqshgkERIXded2lSxR9j+Y0NPADRsGqXgGUuvX5VndA 64q68kuPmRJlOO/MC79cldwvdar8Pk5JJsrAeBQofFWS3Q+BiEZ2OCfpc45d2T3J3l/y/rsR1 OeAEFto0ioElhHIbHCgGvEsIz5z4B8p5fMpFk53BzSlbfcAt/6s4t3PqZ1AtTFEbDtv0pTMCU VAxt1dfccyFUPNipcSLrBu29CLQ1zGfmf8XTpukt9zJU7LpM6nizT4Bb6Yq++ZxpwTPPiKe3Q U/krDVTRxTkHF74X+Xe8++6gS6YCKBbLfJTvo3f9ihL1yqQUqTGtYqUjfNYBGvQBuH7eti6Li xOZD4Ew Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 7 Apr 2017 22:20:39 +0200 Replace the specification of three data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determinations a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring Acked-by: Sagi Grimberg --- drivers/infiniband/ulp/isert/ib_isert.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index c56af6183082..5dafda92a642 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -368,7 +368,7 @@ isert_device_get(struct rdma_cm_id *cma_id) } } - device = kzalloc(sizeof(struct isert_device), GFP_KERNEL); + device = kzalloc(sizeof(*device), GFP_KERNEL); if (!device) { mutex_unlock(&device_list_mutex); return ERR_PTR(-ENOMEM); @@ -516,7 +516,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) isert_dbg("cma_id: %p, portal: %p\n", cma_id, cma_id->context); - isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL); + isert_conn = kzalloc(sizeof(*isert_conn), GFP_KERNEL); if (!isert_conn) return -ENOMEM; @@ -2306,7 +2306,7 @@ isert_setup_np(struct iscsi_np *np, struct rdma_cm_id *isert_lid; int ret; - isert_np = kzalloc(sizeof(struct isert_np), GFP_KERNEL); + isert_np = kzalloc(sizeof(*isert_np), GFP_KERNEL); if (!isert_np) return -ENOMEM;