From patchwork Wed Aug 2 09:32:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13337944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DA5EC001DE for ; Wed, 2 Aug 2023 09:44:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232897AbjHBJog (ORCPT ); Wed, 2 Aug 2023 05:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233018AbjHBJod (ORCPT ); Wed, 2 Aug 2023 05:44:33 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E91F2D62 for ; Wed, 2 Aug 2023 02:44:30 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68336d06620so6413810b3a.1 for ; Wed, 02 Aug 2023 02:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1690969469; x=1691574269; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=SVFLZxE4bi7nIomxkzjosB2yD8XTN0moseuf6EhwKFI=; b=gvx5QcitsG9qFX6Gl22Q9nWCGeNwBEnEz6YrgE2O+sfy7XRB7t4GwXvk4VoTO0czuf CiKXsYBMuU+wv3PPxxneHNtc01xcmyuyEd/GXRmmoa8ktGM28/5wdLZTCG8ctU66jepl JohIxTTgtCPbSdYvvbDt8e7ND0Ls32zEJH2Uo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690969469; x=1691574269; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SVFLZxE4bi7nIomxkzjosB2yD8XTN0moseuf6EhwKFI=; b=JQUQXNHj/NXzMBYfjJ3PXZZijIb5iBOMlB/FQTCF1S/RsvMiGROn/5QH8B1aQemb6I hVNY2JT+0pxeI98g4EE7p8cU6RT4/zaVhIOnsA5eGXSiTE/p7M849ysgtVY6uCqlDS9E l2zYUoZmcEqU7UYy0WD12CRIqp+AwJRZDcTCVvEp5Hf0RySrbQ4hIiIKDaHcE4Nf1kNC aM1dWZMOzhF3beyrzbLLmsq8w/ujvxwCXdFZRSSdKLr7YQ3knHpt8TbgjRk5Rgm5i63z MYGzZlB8bCoeW0rHeqNSqHdatlCAiDak0o4+kFnkPsbAhV4abGobO2c+3tE2b6j8xVtq 85GQ== X-Gm-Message-State: ABy/qLZR+v8i2wj9mWEfB/pOWhklKaiogHSqG8NdFzJsDmkN9m/Gbc1S hNlLL2HZ/6A86M7MVpxuaKf/xw== X-Google-Smtp-Source: APBJJlFZKsCCBLgHLerBRnFkwiAANWWO65mfDvO1Ef0AYSywoC+gF1xuzOD66U33eFpKEbV706BcWg== X-Received: by 2002:a17:90a:3ec2:b0:268:14a0:f8a with SMTP id k60-20020a17090a3ec200b0026814a00f8amr14729627pjc.39.1690969469282; Wed, 02 Aug 2023 02:44:29 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 5-20020a17090a000500b00263dfe9b972sm848790pja.0.2023.08.02.02.44.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2023 02:44:28 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Kalesh AP , Selvin Xavier Subject: [PATCH for-next 4/6] RDMA/bnxt_re: Cleanup bnxt_re_process_raw_qp_pkt_rx() function Date: Wed, 2 Aug 2023 02:32:37 -0700 Message-Id: <1690968759-9142-5-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1690968759-9142-1-git-send-email-selvin.xavier@broadcom.com> References: <1690968759-9142-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kalesh AP - Remove unnecessary memset by initializing the variables during declaration itself. - Arranged variable declarartion in RCT order. Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index c46fd2a..1ce3922 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -3333,26 +3333,21 @@ static int bnxt_re_process_raw_qp_pkt_rx(struct bnxt_re_qp *gsi_qp, struct bnxt_re_dev *rdev = gsi_qp->rdev; struct bnxt_re_sqp_entries *sqp_entry = NULL; struct bnxt_re_qp *gsi_sqp = rdev->gsi_ctx.gsi_sqp; + dma_addr_t shrq_hdr_buf_map; + struct ib_sge s_sge[2] = {}; + struct ib_sge r_sge[2] = {}; struct bnxt_re_ah *gsi_sah; + struct ib_recv_wr rwr = {}; + dma_addr_t rq_hdr_buf_map; + struct ib_ud_wr udwr = {}; struct ib_send_wr *swr; - struct ib_ud_wr udwr; - struct ib_recv_wr rwr; + u32 skip_bytes = 0; int pkt_type = 0; - u32 tbl_idx; void *rq_hdr_buf; - dma_addr_t rq_hdr_buf_map; - dma_addr_t shrq_hdr_buf_map; u32 offset = 0; - u32 skip_bytes = 0; - struct ib_sge s_sge[2]; - struct ib_sge r_sge[2]; + u32 tbl_idx; int rc; - memset(&udwr, 0, sizeof(udwr)); - memset(&rwr, 0, sizeof(rwr)); - memset(&s_sge, 0, sizeof(s_sge)); - memset(&r_sge, 0, sizeof(r_sge)); - swr = &udwr.wr; tbl_idx = cqe->wr_id;