From patchwork Thu Aug 3 08:45:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13339560 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 9E514C04A6A for ; Thu, 3 Aug 2023 08:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234874AbjHCI5W (ORCPT ); Thu, 3 Aug 2023 04:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234871AbjHCI5V (ORCPT ); Thu, 3 Aug 2023 04:57:21 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 228AD1BF9 for ; Thu, 3 Aug 2023 01:57:18 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68336d06620so632774b3a.1 for ; Thu, 03 Aug 2023 01:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691053037; x=1691657837; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=nUyHzlyEIRFrBY5X4d4XUtsg15vlwHmjhQ84S+665dM=; b=NELiDRzlDhTe1mbE1piT66Rc5xBDKJQrUo1+jS3Qn+RBE9R3nGekFd9+4pHZO2YQ7Y iO3hC+VnHFaWIvEasPkVtoJK5CP/ed753AQ8zBUDIZtubPDr7437GUJUmKnxfRTIo0nq 454Yak/OENoE7Fcs10jDTA2weND/ukW6Tuq/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691053037; x=1691657837; 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=nUyHzlyEIRFrBY5X4d4XUtsg15vlwHmjhQ84S+665dM=; b=GBgXmrSXaP1YaDLL1Yt/YXDj521qEZQtvxWlpjIWgB6tEAIWMX7sQEcccP79iAKSr5 AJDy8ViwQRgAHkFWPnwPnvJP070ziZ7WM4lToYKqvFMxZoUS+5tKj/toZyCVPSi76ip6 o4pekup7FBQgYgveCGgFGDpACvBvZv2nbw0u3cJt68tXUGn6eML9RvTLIgrUl7l5Z3Lk E1oD3VIVEpG1hRYhPdNTdLZvx1sfYIYaz7QZy22BVvKCENylUBBg891AZKmYSFUZT7rT r/1N5dgSjRdfXrK7hMG2sQ94PEyU8w7vKDhB4z7nWYlje/p3XgMkhtAk7KfLI5OAnYz9 b+aw== X-Gm-Message-State: ABy/qLbJezABRtamYAl/ylDmJBG5YliqtEop02lYhaMh1mLUWBhKllpI 91nVYx09oopsVDP+KdJtyFK0ow== X-Google-Smtp-Source: APBJJlFAAexc20atguER5ZL3aUu74uXKmZ+yoALpxyZcb0bXc07m1DMhhCePTxXSSOYDGf0hAIFp7A== X-Received: by 2002:a05:6a00:3a0d:b0:67a:8fc7:1b61 with SMTP id fj13-20020a056a003a0d00b0067a8fc71b61mr19625837pfb.11.1691053037254; Thu, 03 Aug 2023 01:57:17 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x42-20020a056a000bea00b0068713008f98sm10289035pfu.129.2023.08.03.01.57.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2023 01:57:16 -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 v2 4/6] RDMA/bnxt_re: Cleanup bnxt_re_process_raw_qp_pkt_rx() function Date: Thu, 3 Aug 2023 01:45:24 -0700 Message-Id: <1691052326-32143-5-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1691052326-32143-1-git-send-email-selvin.xavier@broadcom.com> References: <1691052326-32143-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;