From patchwork Thu May 11 07:26:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13237586 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 613E9C77B7F for ; Thu, 11 May 2023 07:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237300AbjEKHi0 (ORCPT ); Thu, 11 May 2023 03:38:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237235AbjEKHiZ (ORCPT ); Thu, 11 May 2023 03:38:25 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76F8A1BF7 for ; Thu, 11 May 2023 00:38:24 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-643b60855c8so6170004b3a.2 for ; Thu, 11 May 2023 00:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1683790704; x=1686382704; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=di+SHqeVj9QmRe4ujYh4WXFlSRHPHSvfuxl18Y4kYFk=; b=OxmlaWUiAIhVjVboikzKSbAP87qrEPJgVAvrzQx0a51xFMs0rkPrVJYifSF6wFYDwC BJfB8XGYQx8rUAHqzMBqpww9i6jL2CswtNwqhUnWjt8SGXlcXT5nKtF9+xfjFTS2NnOs 25v4AuvN/kGfLZWZRQO4CrMiaCBcHW89tJnfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683790704; x=1686382704; 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=di+SHqeVj9QmRe4ujYh4WXFlSRHPHSvfuxl18Y4kYFk=; b=UCw2Y1BjIhUa2kYmAbsfzT6/SdoQWdJDkoTJfMuCem2gNMF7JfuHoOuhoMMzT0Zmau gI90BkndJ+3Yo8EbXMuBJXnSfLnajR/80ssEp7bczRqUrSkO4HmZCqFwkjNgM6u1lieS zuo/uIQHH52miU21uClKUZhhkdK4j2A3iryZ9jmW/7vHDY3blU2ZeBKHVGw5+ehjwxOi fgWl8vQ+C//JpmUx8cYvXiabSpb0913Mdk6fK/xIx011plniS2CAYPhgyxPvgpL2Wqjx viJ3CIn4yGB/vFiobZVr16O58XiFZkWnai8u3YfZx0gCQxcHWD3WP8tIkdmjyB1wMmUc Q+EA== X-Gm-Message-State: AC+VfDyyAwozD86W/vcL4LwFyk1+5WRzpFMR7O/Ghhw1h3sLzWo/vBH8 NUgDDhewgIZCFsshxkzf1w+801MUIdrC8XuupsE= X-Google-Smtp-Source: ACHHUZ4UlE4daxr1+UqruO1FHIWNGb9l1pBHT13pk26pXcDlIOaeOlAY6cGg6npgehMu18l8n1gzvw== X-Received: by 2002:a05:6a20:5481:b0:101:7ccd:e195 with SMTP id i1-20020a056a20548100b001017ccde195mr10686349pzk.8.1683790703873; Thu, 11 May 2023 00:38:23 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id n14-20020a65488e000000b00502f4c62fd3sm4174332pgs.33.2023.05.11.00.38.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2023 00:38:23 -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-rc 02/10] RDMA/bnxt_re: Fix to remove unnecessary return labels Date: Thu, 11 May 2023 00:26:17 -0700 Message-Id: <1683789985-22917-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1683789985-22917-1-git-send-email-selvin.xavier@broadcom.com> References: <1683789985-22917-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kalesh AP If there is no cleanup needed then just return directly. This cleans up the code and improve readability. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Reviewed-by: Kashyap Desai Reviewed-by: Saravanan Vajravel Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 8974f62..e42c756 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -1614,7 +1614,7 @@ static int bnxt_qplib_put_inline(struct bnxt_qplib_qp *qp, il_src = (void *)wqe->sg_list[indx].addr; t_len += len; if (t_len > qp->max_inline_data) - goto bad; + return -ENOMEM; while (len) { if (pull_dst) { pull_dst = false; @@ -1638,8 +1638,6 @@ static int bnxt_qplib_put_inline(struct bnxt_qplib_qp *qp, } return t_len; -bad: - return -ENOMEM; } static u32 bnxt_qplib_put_sges(struct bnxt_qplib_hwq *hwq, @@ -2069,7 +2067,7 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) hwq_attr.sginfo = &cq->sg_info; rc = bnxt_qplib_alloc_init_hwq(&cq->hwq, &hwq_attr); if (rc) - goto exit; + return rc; bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req, CMDQ_BASE_OPCODE_CREATE_CQ, @@ -2112,7 +2110,6 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) fail: bnxt_qplib_free_hwq(res, &cq->hwq); -exit: return rc; }