From patchwork Wed Mar 8 12:53:17 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: 9611041 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 8A03C6016C for ; Wed, 8 Mar 2017 13:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEB5428356 for ; Wed, 8 Mar 2017 13:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2C4628585; Wed, 8 Mar 2017 13:12:37 +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 73E7028356 for ; Wed, 8 Mar 2017 13:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753193AbdCHNMb (ORCPT ); Wed, 8 Mar 2017 08:12:31 -0500 Received: from mout.web.de ([212.227.15.14]:55700 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbdCHNMQ (ORCPT ); Wed, 8 Mar 2017 08:12:16 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MGRI8-1cYLXC46wi-00DKWQ; Wed, 08 Mar 2017 13:53:19 +0100 Subject: [PATCH 06/26] IB/ocrdma: Improve another size determination in ocrdma_alloc_pd_pool() To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <00537ca7-1c89-b1a0-8faf-eb1c65a114ec@users.sourceforge.net> Date: Wed, 8 Mar 2017 13:53:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:5o7j+Q+EkFms1W2t5BzEQnEmTAS4UCcxZMCYD2rws6EgT1Kgj5f e4MZASjuChDAv9AsKA3fTZwkCMrGVTqOjHD4hZG151pOjvMAVEUUANRaBpc0X7zw3mV9YzC rk5g5q9EPFhOr8F+uKGM9XQin4d+tZ+PZN3odsh3k5O7ocHSEDRsAWjVstd/9t8DHwsLyf9 C9zv0ilfqCUUGCzlyRmow== X-UI-Out-Filterresults: notjunk:1; V01:K0:R6NGamPlgzM=:KL1xWwSyWoYaQmh5gv2i23 BrefcQfhDgQ4p/i+jSkllkf+CkLPpmIYPa9mDpd2WVHNRcQVpyW64w81bHy1VoxJH447KoiHH QUuw6STpTr72JT2C4Z6whcNs+b3i7yneGyf9iHa6jZeyWDNtf20nHwjuB+ZzgU/aaiiuD9c0I /3+dDf3jJfqYy6S/R8j66oc04djMrmISjsg2G1fLRMbNBbpZEoa4/WjU+s3QaHa4bkYT+5eGm 1dskm9ULenzBiM9nQE6MrsMmmixTCz7QbFhcCqBRaKh5t77w5DWjiNUJ3sruJUI0OJkF2zlpE yRTc6yYckgCLiDF8zYDutg3nrgLAaPjdgcrUEw4glZEd9DRiaI/bRzV18naUWpEO2jVQ6YM9i +Y0V/1sJ2GbvNKox4y8tAsVKUOZyQW8xN0gaXysvDJKY+KtB4tY0IO8PNQ8EJFclt2GTj0WtA YlaZsisux6/HaOi9/wBs8BQnivtpYNmsT9P+6KnaTNp67n5oLklxLq9hMHrp5Z/0HCRgGSr36 BWcox56bmH6LEaJwWIbxZvRu3gxIJq7+vFugD7ns0eio9dKQOGc+KdiwhAUfD474oj/7jKDNS IYe6hISw/v2dSk06z0MMwQem7OeK9oyezKt35XFglK4a1wF4R9fFjd/LUvLcj3kAmnWqGJBwC 32BfPuDkafaEouOdwgGuaKvLM3N3+vFrtXlHPhypHeSKrAza4OsJMrMVOguS6TKa70eMbXlO6 i2nwg22BRm9A7nslpM4mTJOiNf6yi8B+pj8kpwq1bMCFoi4RCF0sVNKtt6qaDb8HFi1Zv+3Q8 jY7apQV 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: Tue, 7 Mar 2017 19:54: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 --- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 8122a1c7d2ae..56f29e06dfe4 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -1595,8 +1595,7 @@ void ocrdma_alloc_pd_pool(struct ocrdma_dev *dev) { int status; - dev->pd_mgr = kzalloc(sizeof(struct ocrdma_pd_resource_mgr), - GFP_KERNEL); + dev->pd_mgr = kzalloc(sizeof(*dev->pd_mgr), GFP_KERNEL); if (!dev->pd_mgr) return;