From patchwork Wed Mar 8 13:02:46 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: 9611049 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 5CAFB6016C for ; Wed, 8 Mar 2017 13:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 809942793B for ; Wed, 8 Mar 2017 13:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73A3B2858F; Wed, 8 Mar 2017 13:21:19 +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 01CF02793B for ; Wed, 8 Mar 2017 13:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753027AbdCHNVG (ORCPT ); Wed, 8 Mar 2017 08:21:06 -0500 Received: from mout.web.de ([212.227.15.14]:55181 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753193AbdCHNUi (ORCPT ); Wed, 8 Mar 2017 08:20:38 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M7KOE-1c157Z2F2k-00x0fr; Wed, 08 Mar 2017 14:02:47 +0100 Subject: [PATCH 10/26] IB/ocrdma: Improve another size determination in ocrdma_init_emb_mqe() 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: <4d92b910-f0fb-1362-0392-fccd8af1d169@users.sourceforge.net> Date: Wed, 8 Mar 2017 14:02:46 +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:CPjjONXBY40O5yw+Xj1TalOgDFIo/jfa+g22i7KZhE8Bij8Qleh 7k2SX0rL0plc5WIwJrGwD+KRdGmUdooiFY+00ghWY5EIuO5DvwIgmvdMNae5uQkFO+b6BuB 6wxuHniLW6BCuzF6Y+6Jj8g1DdVq6udVlklwgFQQej72QUvLTtpi+wY7KV0fX2i9hGL13zt kdGVVOb20BUvPT4oVZ2Cw== X-UI-Out-Filterresults: notjunk:1; V01:K0:WFlXM2EWHMw=:MIbte/s7IvHgeVLGrZIFWH 4yw04P6ErkFH+wDhrEtfHjK/PlRmAxQeCGF+4IHiySVZ00cqEHgX6ouduNVCvgqniJzGS6JkR zlf6Ums8nQte8/5lVBn/tdiPRPUKax1v1GTF5g0HyTULrVziVnThfDR4cMb9LohsSyhGvW2W2 yd+p46NJ+Qcv6bd/iDyVya7Yc9dCxbrEJVmEkwOOxgoHqA4py8CwbePA4J7YYBh2NeghvVj4L T2YitNacsVWIzXgWtjQD6aFunfWeYH8fD1sWwQBdbI8AaUDESD7kcJddXn7y2sCrpwnC80jtQ pYPs2UdrOhFu25xixu9E6T5+/ypXs1YGo0vvUxdx7dyHHu+GJ29xtB/TkaRiNViCrVzGzO6wt /YFQqLMS/4Or4lbNGaRnayFDZXK3bwisIWJtlu//O1en/u2hT0PUykB0m/yr9r8xdsU2/YNmv Unscj5O99h1AJPGvl/TKaBzwdhNws1vtau3DZWJc+X0Ax3UwD6EU+0W9naK2/96Y7W/WQ/SF1 zKs6Wk/KuxThc+yKloJ/08P/KrlaiHnqbrPP/dETuWlxqFiz3xbo9ZYYsewjzuW7rhVaamNBX 5VX5fZhx3Dx3fXdP0SiJB1ZOF+haRceIwnidHJwuHS1JL3Wzfz1nfclFgxQwqSV+ZL/ii4+VV LEIHIR+3m2QpnV2pWKXHVj6AQIXJbYRBCvgO42hpgYcmswT80txAAInK9EzgTACig6XrU1wiT I25arDNTPHwbLWXrsY5OBk6uTUrCq/If7e8HlyEKRgFsrywft0ILqAVRD0ViNhJbu8T+I/n6U vVb89gC 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 20:33:29 +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 Acked-by: Devesh Sharma --- 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 7d1e1caa90de..aa32bc9f323d 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -352,7 +352,7 @@ static void *ocrdma_init_emb_mqe(u8 opcode, u32 cmd_len) { struct ocrdma_mqe *mqe; - mqe = kzalloc(sizeof(struct ocrdma_mqe), GFP_KERNEL); + mqe = kzalloc(sizeof(*mqe), GFP_KERNEL); if (!mqe) return NULL; mqe->hdr.spcl_sge_cnt_emb |=