From patchwork Mon Mar 6 17:44:56 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: 9607263 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 8C121602B4 for ; Mon, 6 Mar 2017 18:25:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E92279B3 for ; Mon, 6 Mar 2017 18:25:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75A7827BFF; Mon, 6 Mar 2017 18:25:50 +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 2EB0927BE5 for ; Mon, 6 Mar 2017 18:25:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752935AbdCFSZs (ORCPT ); Mon, 6 Mar 2017 13:25:48 -0500 Received: from mout.web.de ([217.72.192.78]:65074 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151AbdCFSZq (ORCPT ); Mon, 6 Mar 2017 13:25:46 -0500 Received: from [192.168.1.2] ([78.48.114.236]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lu52Q-1cJtxn3N6k-011QfK; Mon, 06 Mar 2017 18:44:57 +0100 Subject: [PATCH 5/5] IB/nes: Improve size determinations in two functions To: linux-rdma@vger.kernel.org, Doug Ledford , Faisal Latif , Hal Rosenstock , Sean Hefty References: <502a5a6f-ee91-dd2f-cdc7-63f396059529@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <540c6942-94c8-4042-0bd0-62dc9140a0c6@users.sourceforge.net> Date: Mon, 6 Mar 2017 18:44:56 +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: <502a5a6f-ee91-dd2f-cdc7-63f396059529@users.sourceforge.net> X-Provags-ID: V03:K0:lE2G04y7YgskV5y9zxAgZvWo0GDtBOJrC48KW4DTHXOa/zz1DLf AJq+uTj8NeT+DvuxQhnVH5RBrbx+Gxrb8WQNWl+NL8W7FGpBNunu3+lWPUzx6l+wK1bDjVW Lv/94UtcHmaXJ0BUtCVfjbjOWnMOLYhlNAQgjhbrqjh+65ZVT7qowNZ7x5hY6k8Mo/dVYkN Ccgh8QQfC4UVDNnZDghSw== X-UI-Out-Filterresults: notjunk:1; V01:K0:iwAaT58tfiM=:7gLJM/XhwKSszkBcu9pk80 o5ZeDeDjHM1sNz6lhstgdR4EUyWoz93z0hIy3RTkLBAeVpznddP42QoCmCx2bYN/NPsZku4y8 uVPGbcuybIXz3YAK2icBMXHCBHVWQZAwkYZrjJCP/tw2tyZcLlN834hGuMic1Qg+pcbbXSoyh AmXFoqTRMziA6TmkjqV30+I6bjMGj6yBtXBwO8/WvPkfG02nO+LqS8ivh30NzZmyVUWYkX+dS Rm3B9Ikec+FfgvxCPIXmEs295Dxl9I+29gk93iGeBFJy9VkBqHH+ojCphd7ODdDDLjjs8gisz wwU3Si0ix13jHf+yx8c5dQ3uRpvoUVZ0gu9P0vBBTu0ysYK3NQSbMP0Qhuw9onI9vbazjmgre aJhyHQNVVMXBOi/2bayP6giZUYZt0TTJiCtCqGLmIldqvELHMsJ4TNp7xa5/qJqnRUXe/ZIkl b94IGw7cCPivxKwb5Ahp12dAXre0F48oVe6opzmTD13o02sE1w9kj1u4IAfI787UZSIjvT1vj 1uWnihgMaRN/wVe2CzBy/6vI6xKdRi9qMDs7+JVVsPUmLT/0vRDvkX4kGs+3pBIktCE8WynHI poYkORRKvGcqvHFPPA95SuKlBh7bOptM2Gqy113wDo7NVRCrpLkeFoIbvTMZe2LcUGqNSW9Gx kHWOZ7HMfilloE4QL0AJpaH+EEaOqK/J+RAc5p4OQ/WrSh0YnYOn0OW378qr5TfC1bB/CY367 xL8PxnljperLszBel/NR1cPud/Jq5uAcWdUCdf5nQHidAuq/5xlSR08de242C380om9hZmv4x rM2Xvao 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: Mon, 6 Mar 2017 18:12:37 +0100 Replace the specification of two 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 --- drivers/infiniband/hw/nes/nes_verbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 7764ba423c1c..5cbb62e44d84 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -678,7 +678,7 @@ static struct ib_pd *nes_alloc_pd(struct ib_device *ibdev, if (err) return ERR_PTR(err); - nespd = kzalloc(sizeof (struct nes_pd), GFP_KERNEL); + nespd = kzalloc(sizeof(*nespd), GFP_KERNEL); if (!nespd) { nes_free_resource(nesadapter, nesadapter->allocated_pds, pd_num); return ERR_PTR(-ENOMEM); @@ -1447,7 +1447,7 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev, if (err) return ERR_PTR(err); - nescq = kzalloc(sizeof(struct nes_cq), GFP_KERNEL); + nescq = kzalloc(sizeof(*nescq), GFP_KERNEL); if (!nescq) { nes_free_resource(nesadapter, nesadapter->allocated_cqs, cq_num); return ERR_PTR(-ENOMEM);