From patchwork Mon May 22 14:12:21 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: 9740599 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 BC92B601C2 for ; Mon, 22 May 2017 14:12:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD1201FEBD for ; Mon, 22 May 2017 14:12:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A156C28473; Mon, 22 May 2017 14:12:41 +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 4667B1FEBD for ; Mon, 22 May 2017 14:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934443AbdEVOMj (ORCPT ); Mon, 22 May 2017 10:12:39 -0400 Received: from mout.web.de ([212.227.15.4]:52573 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934416AbdEVOMi (ORCPT ); Mon, 22 May 2017 10:12:38 -0400 Received: from [192.168.1.2] ([78.49.33.162]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LhyU6-1dgrqE0aLC-00n9B5; Mon, 22 May 2017 16:12:24 +0200 Subject: [PATCH 2/3] RDS: IB: Improve a size determination in rds_ib_add_one() From: SF Markus Elfring To: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, rds-devel@oss.oracle.com, "David S. Miller" , Santosh Shilimkar , Sowmini Varadhan Cc: LKML , kernel-janitors@vger.kernel.org References: <44b46c51-3665-5f14-dd3b-6e6f230258a7@users.sourceforge.net> Message-ID: Date: Mon, 22 May 2017 16:12:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <44b46c51-3665-5f14-dd3b-6e6f230258a7@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:l+xQlLVG8bxCb7NY0Re19JZiD418il11iE+MJ0rNqZEdlpjChws +QefigUIkIe4M6KtJSHVQ5k3zm/HVBxFkFYY008SDDufAnV1+M2Gp0U3uzYqe/3Xw1aSwWG Q+pvJKt2Xh8sMcHYg93O2vftW0dzC+nTFOxDy3soxR4ER+4/rGpGXrjOjpUsdrAQdC0FMoY 9gmi/VVwQr9jDnX0FVIFg== X-UI-Out-Filterresults: notjunk:1; V01:K0:RqmOtEdiXko=:KvwcJ8glrYpQPU8YL/Xsp0 erTMvLk9RTX8bHdVpJFuVUIkB7TLSRYu6adwACClv3zYckbDWC7nFIwwmvPwZR4O+P+MSYSY+ kqQgJGTmVhqnxondElnQrP9bDXzYGaj16v/1i7kx28C8wUOnjTbayr/C+YQVwLnDF3hWYjVIq Ls3lTjzgwf44xr/I/cFo+eE8LwaELi1nX4jnYMZlQSF7mS/InNSox+dg6g4mrMuY7kwZRZwfI WWF6Is0Aj0QbwQtXgFx4LK1RoaMeZ2t3le9LjwJ/ygzs2e3t5JhW5udZMtqeE9bOFBbFHduZK VCDsnNkYG6LKd21b4fQT3yBYTDaAUl0YgHTqBSEHvyjMrsvU63yF65MHfgsquz7R2BX5/F43N shUbdkjt52IWIZhuUJi//RbjN6miVQPxZVFJr33Ur6VUVbVlVj/VU0BMh/N2vimbp9dh1rhTw 9T2Z86s4JwZiASHA0Pjs7sy+2YBO3/s6B32EdeCvBY1+5wCqFDkI+CCxhB/g+NGcuXWpz4OUU NKJOVrHuFJuAXynF2GoYWheAwodKyAnnu/Jrud/TOnv7Zhz1GLXtAUeuvYcgNAaURL6W5HahI z/AuR5/HVOrhv7AZ2IrpBqLkvor+YYfO3BzwVEgFhPZlDXDLiP31RjvFXaTtHsmGWaqzpsdab gQdCz5PTqIoZbHaVER2DtpVqDWN4ob6yuAo24bFz6/9oIL/knGDVKCwrw0vVp9ImjMBuys3VB sRg63ef2y+j4XCyzBOVcMx9nEtermAK9gptdkx+O4OpqdIBuDmrI/XWq7bTkhtxAVPDe8AyZC m/0Wwtk 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, 22 May 2017 15:40:21 +0200 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 Acked-by: Santosh Shilimkar --- net/rds/ib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/ib.c b/net/rds/ib.c index c5514d058171..ed37bf011704 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -131,7 +131,7 @@ static void rds_ib_add_one(struct ib_device *device) if (device->node_type != RDMA_NODE_IB_CA) return; - rds_ibdev = kzalloc_node(sizeof(struct rds_ib_device), GFP_KERNEL, + rds_ibdev = kzalloc_node(sizeof(*rds_ibdev), GFP_KERNEL, ibdev_to_node(device)); if (!rds_ibdev) return;