From patchwork Wed Mar 8 13:00: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: 9611039 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 F08D26016C for ; Wed, 8 Mar 2017 13:11:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4161728582 for ; Wed, 8 Mar 2017 13:11:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3633D28586; Wed, 8 Mar 2017 13:11: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 E1FAB28582 for ; Wed, 8 Mar 2017 13:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753233AbdCHNLD (ORCPT ); Wed, 8 Mar 2017 08:11:03 -0500 Received: from mout.web.de ([212.227.15.4]:50699 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752818AbdCHNKX (ORCPT ); Wed, 8 Mar 2017 08:10:23 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Ls92l-1c7z1d2WIZ-013vSj; Wed, 08 Mar 2017 14:01:02 +0100 Subject: [PATCH 09/26] IB/ocrdma: Improve another size determination in ocrdma_mq_cq_handler() 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: <62b28436-076d-588d-49c7-da2a69239fe5@users.sourceforge.net> Date: Wed, 8 Mar 2017 14:00:56 +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:ZrrTbqfkqYwl3T3HGf7bu43hUJzOyRhRjmd5/ufY4vdB1ilIbL8 p4PU2x5IZEcuSqSV16GUB0hz6h2KjyPcR1zCR7ir9zqVn51qokHTcw8X5nPsa8EKizAcgRi 2k2o3OrYWEzGc507EJkinRN7Z+TBMoNj6Royc5Ei5qywtp3j7eBVLFGMHW/D2CeeorgJQYp 0soqAIJNOdI22ijaAo+Qw== X-UI-Out-Filterresults: notjunk:1; V01:K0:H1BJro7btNk=:FB054GNjh+wH+aMkTSs8mG NL+Qx5W82T3hR/lB7I1DbgSv27p2buR7xG5EfhVCflW6/aqxRNHQItdGxcggEkhudG61o0Grr TioaGyZJ4MEfGQGGSW7IA4QUvbEE2LV/RzCKl2T4yVaqng0c7sQ+kmj+qiy2rmOyryYwwK9V+ +GnP8ZUre43gRWBOZrgKDqOSuAXMu3VHqwGSHRu3gTLRcK6+73WbcVeylnm7TMhkWiYTD+Hzz zINDGpySmeLjkW4YqCtWY4igjqdNisZTCR6haLgrc9kDigXztZGGAnvg5zckqu/f8qyH9+v6T F0eUWhpLh80VfYULp1yPyEoL6JBKY94DLFs4ZPv4a63k+g7ve6xFCkJFC4gv7FaWl98nMnvTA AkhVW6NtfFElR+GEq/Z+DVAtJGqi438RQOm/pQfLuRmzj4Rfbt4QsWMXezl0B+d0CHUt8mckM KMw+pvtUpUNca+d8HFK5nXFmzW7akhz+o2bbE2c91lXhhv2bPc2tv6qO1KdTJ7EEgfGr3fS72 IDl/ANLEwB7V9ckpK3LdC9yMYsw/8hhCTcDd1Vo9UlrJxGFSS+V8RY4qQ8RqdJjqxqJh0ubCk MuNJHxkEwxsUymVP87bBlY8ZfAs+AM8LMwvDNOtdXEHcF1Mly42AtSbqQElEvrgTy8zYZa0TP 2RRxDNvh9u17WH1Gfe/NNMJLF4TiNIwtBkTILLIcZostUgezRKfzDyf+mHXTV5tp1aVP1afJo +NXNuWH13/ILvHVPsJDDEuPsVKcwaefMWaolq9fnzPLgbwbhXOaADt46sZeVufzSwvTNCtiWd hvEZeCW 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:20:45 +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 0628600bee56..7d1e1caa90de 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -890,7 +890,7 @@ static int ocrdma_mq_cq_handler(struct ocrdma_dev *dev, u16 cq_id) ocrdma_process_acqe(dev, cqe); else if (cqe->valid_ae_cmpl_cons & OCRDMA_MCQE_CMPL_MASK) ocrdma_process_mcqe(dev, cqe); - memset(cqe, 0, sizeof(struct ocrdma_mcqe)); + memset(cqe, 0, sizeof(*cqe)); ocrdma_mcq_inc_tail(dev); } ocrdma_ring_cq_db(dev, dev->mq.cq.id, true, false, cqe_popped);