From patchwork Fri May 19 06:48:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13247722 X-Patchwork-Delegate: jgg@ziepe.ca 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 32A5DC7EE2A for ; Fri, 19 May 2023 07:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbjESHAF (ORCPT ); Fri, 19 May 2023 03:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbjESHAD (ORCPT ); Fri, 19 May 2023 03:00:03 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F540E6B for ; Fri, 19 May 2023 00:00:02 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-25345ca8748so2450938a91.1 for ; Fri, 19 May 2023 00:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1684479602; x=1687071602; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=VBhA1BDo7tNLIXIcmXsSfthRe6QvSPZEbFRDL5EJdn0=; b=A2PPLyebpzCKIAxXXd1Aea+Zv6pn+LdMHcbGChiRUjzQjojEcM6PAD+GXXIlrbKjwY oQ9Ta6PR6DawOy1wRxf1f84BbPDk5ba99Ij+89jhwf7vPxqGvd1NaTYNf704dVLLGBL1 aAl7KfKDRwKiSDtBDKHPVYHR2hDaSRzTqMRYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684479602; x=1687071602; 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=VBhA1BDo7tNLIXIcmXsSfthRe6QvSPZEbFRDL5EJdn0=; b=GIUvUsDX70p2+0e45wWNOBm3JceoZLtuSv+y6ygyGH7QhA+JgI9t55+Ry4zTfBN2F6 ZarlFigLGnnAi1ifoGZYm87iuD92hR6Wzs9yVeFDyERr7G+d9Dba19q2V+p2fVsD8nZN m6SbY5ey0nr1iFvB0cNYMYfJOFaL0P37md1iCVl2TNELlpLIbWNL62206diPKBRC5g0+ F0ohpbez7Es7E3vb/I5axbe0rCapMpje/YJKVz9EeV9eQSnQCcKTM0WUdJ0aX0QM3gUc LhDdDIG8S5AlAuAYwlFFmE0TEdjzZZqVTfMp+H4N6LB3GZbeiS3qoemMQQizgikqikAE F3mA== X-Gm-Message-State: AC+VfDzK05WoKapbuKmsgs/FqNJmxHost84jgj/KclGRjicxfFAX0xos LHvAY1Uc6naFvEswIELsYv5aOA== X-Google-Smtp-Source: ACHHUZ6Xf/CtOsojND0mvMmYBzP8ai43aS0D5niaLNhqxzordQ4obtg3xB2UHwQeEM/lCWkAoyOGVg== X-Received: by 2002:a17:902:e5ce:b0:1ac:b449:352d with SMTP id u14-20020a170902e5ce00b001acb449352dmr1932821plf.61.1684479601894; Fri, 19 May 2023 00:00:01 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id ju19-20020a170903429300b001a64c4023aesm2654279plb.36.2023.05.18.23.59.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2023 00:00:01 -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 2/7] RDMA/bnxt_re: Fix to remove unnecessary return labels Date: Thu, 18 May 2023 23:48:12 -0700 Message-Id: <1684478897-12247-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1684478897-12247-1-git-send-email-selvin.xavier@broadcom.com> References: <1684478897-12247-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 7d756d8..298d893 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -1618,7 +1618,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; @@ -1642,8 +1642,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, @@ -2067,7 +2065,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, @@ -2115,7 +2113,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; }