From patchwork Wed Mar 8 12:50:59 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: 9611003 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 5F8A56046A for ; Wed, 8 Mar 2017 12:53:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 390AA28543 for ; Wed, 8 Mar 2017 12:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D2C62856F; Wed, 8 Mar 2017 12:53:09 +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 CAEEE28543 for ; Wed, 8 Mar 2017 12:53:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753027AbdCHMvv (ORCPT ); Wed, 8 Mar 2017 07:51:51 -0500 Received: from mout.web.de ([212.227.15.3]:62164 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbdCHMve (ORCPT ); Wed, 8 Mar 2017 07:51:34 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lh6bn-1bx54g3T1T-00oZXw; Wed, 08 Mar 2017 13:51:06 +0100 Subject: [PATCH 05/26] IB/ocrdma: Improve another size determination in ocrdma_mbx_query_qp() 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: Date: Wed, 8 Mar 2017 13:50:59 +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:RDf+NDr6su3YTQtr6JwRgvnRUFkeNQ9vqDIvSupM9luODjzIiCH GT8hPPfdgzsC7IxNgSu6iPiVvZmmFCfPpWyuzH0ZJQsGigJD8TmLNImoZ7suMbvHhq5KdZr mDCHSDrOkNlVqd9GUmjqoD12XyZWa+l4/GL5kAjhLBcMCG1ewtVzA2Kn5z3dRGseuJQ+van Yn5D1fjAtqXc3JfEjBg5w== X-UI-Out-Filterresults: notjunk:1; V01:K0:j3bFwxaUvoo=:RPTb2Z/tEK/+btJRYCGao5 lNj8tnpWChfkrNtpX0jVvplgyAZFRqUIPGR8bKN5jRYU63r+OXqiVx7IY4O5ILqZ/+bQdOlAZ z2GN3WbL1FRapV4TxpRYEtGxxjxEHa7g6zUvAQS/RasgaLqkMZ6VI56/WH3IQWwGGLqopwUyg czo6Z0XYalW+UOPwCPn+m770vUm1ZEuh5tyj4dRwKAdeQ6RRcXouoQsG70fbHWjyufFF03s/Z JjgE4ADWJMYXbNpgro+btztr4+yzsmxtvSSDtFw93MmBkVvmTDrDvGjy1gPOS9/m4lIhdaZmN GIGZwq5qhzWBLfu4BgEjTMeePj7qbhSmh8ID/DCPbBpi8/jPwK8CE91VQo4Lem+/N357rHUY2 E+212nsIYf6hcbqM8+tcNrUhL3+OfttBG+EUdGd/o2/D4vzO0E94MsHwYiN034qtPG74yyM9a 4bgLVfdlyrwzgiSwvsjJb5L1gXN1oPeLAYC68fA3QrvfK1LzuvmBc2QtWXplTt4hJJ/3gJXGW JkIbL1C+JoUZP4YEWqfQqOqlYs7oGpCAAqmL0WuUwdWb1T6XXr19OTYt7tAcqzJ88nrP3aMOG 8P1TTQI8jIlshAK1xuKubNCrqKUOtdMcvRrVSCRYN5qvQ4eJnR9r2U6uFTF9YjprkZX/GSSTT 7nIPL1iy19Ew2YguPbjOejIlPwEV5apGJlQK/mheBr27VhPnk1L10gjrO3qYWJwGiq+WAISTX GtWsAQ2hw8tV46QbnfUMWiDvOEHTOdOvMS9UA0kYgC+PSByYmw6qlU5GfAdmwcOPSZ0o77oYn updBfLT 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:40:31 +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 Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 517a18e9351a..8122a1c7d2ae 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -2487,7 +2487,7 @@ int ocrdma_mbx_query_qp(struct ocrdma_dev *dev, struct ocrdma_qp *qp, if (status) goto mbx_err; rsp = (struct ocrdma_query_qp_rsp *)cmd; - memcpy(param, &rsp->params, sizeof(struct ocrdma_qp_params)); + memcpy(param, &rsp->params, sizeof(*param)); mbx_err: kfree(cmd); return status;