From patchwork Fri May 19 06:48:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13247724 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 2E011C77B7A for ; Fri, 19 May 2023 07:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjESHAM (ORCPT ); Fri, 19 May 2023 03:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjESHAL (ORCPT ); Fri, 19 May 2023 03:00:11 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD61410EF for ; Fri, 19 May 2023 00:00:08 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-25343f0c693so2053164a91.3 for ; Fri, 19 May 2023 00:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1684479608; x=1687071608; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=o7Ym4k66W9dDLguK7c6PQcqXFvXNwNB3/8x85NSj2Sk=; b=MUcLUT2v4/SiSPKZXJpQ7erPZde3FzMf5Vb5sQDfHGIcDm+J6dWMCq31GGlulDvGav aKG3rzNWOtPe3FfezxyD+tf4LQeqqp8JxS82E4NhrwLjsEYo1rbM5RSv/yFCG9CibJi0 jJwFCNSanwQi5n50cYmlCT4G/n8IM/JyISrow= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684479608; x=1687071608; 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=o7Ym4k66W9dDLguK7c6PQcqXFvXNwNB3/8x85NSj2Sk=; b=kErmBAqIz21R0RaHZJWU8XtJtAoR67GA+Oi43bfDbjJB8kAHJKho5GQIVtAv8V1mkD r5gAZXp3/ZzH2cZDcipxic8QOAlT81qjLYz7rA75nDraexGGsN7DhXsQnGbdsIhXIlgr cus6AxCk5mgVnKHe3Qe6yX7WYdawTuX0NqZo2CxDW+URi45jzyrDyrKseG46+l8Tg8aQ 0T79zFZzYsxwUt6e+g398/fTycTNTkMx/jEzH88ZvrAf2dq/ZWEjc4zJ5nX1YXl08WiN 44xOmONyYArbFMvpto0NN838mU3oa/QGgYIUQP8WsNcIP3qDgBMHM1XZULmY/sm9Wfwh tElA== X-Gm-Message-State: AC+VfDx3lLx1pKSTOFfLdeMGjGb2LbZbAwSqdQn5N03oLz7fybDSYfPs 0sAz1uFq2jmY0Nf6+yKLV8dwcQ1Lfq5LR4mSS/0= X-Google-Smtp-Source: ACHHUZ6oKJUn4NhdBJOTIgLN//cZR03sgBJxbSJ/UFPDHDieXC1Ay5ymbbT1FmjvHfwz1WR1CmqaXA== X-Received: by 2002:a17:902:c94f:b0:1a9:8ab1:9f3b with SMTP id i15-20020a170902c94f00b001a98ab19f3bmr2198837pla.14.1684479607894; Fri, 19 May 2023 00:00:07 -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.19.00.00.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2023 00:00:06 -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/7] RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid Date: Thu, 18 May 2023 23:48:14 -0700 Message-Id: <1684478897-12247-5-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 The NULL check inside bnxt_re_update_gid() always return false. If sgid_tbl->tbl is not allocated, then dev_init would have failed. Fixes: 5fac5b1b297f ("RDMA/bnxt_re: Add vlan tag for untagged RoCE traffic when PFC is configured") Reviewed-by: Saravanan Vajravel Reviewed-by: Damodharam Ammepalli Reviewed-by: Ajit Khaparde Signed-off-by: Selvin Xavier Signed-off-by: Kalesh AP --- drivers/infiniband/hw/bnxt_re/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index a44f290..4718af6 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -969,12 +969,6 @@ static int bnxt_re_update_gid(struct bnxt_re_dev *rdev) if (!ib_device_try_get(&rdev->ibdev)) return 0; - if (!sgid_tbl) { - ibdev_err(&rdev->ibdev, "QPLIB: SGID table not allocated"); - rc = -EINVAL; - goto out; - } - for (index = 0; index < sgid_tbl->active; index++) { gid_idx = sgid_tbl->hw_id[index]; @@ -992,7 +986,7 @@ static int bnxt_re_update_gid(struct bnxt_re_dev *rdev) rc = bnxt_qplib_update_sgid(sgid_tbl, &gid, gid_idx, rdev->qplib_res.netdev->dev_addr); } -out: + ib_device_put(&rdev->ibdev); return rc; }