From patchwork Thu May 11 07:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13237589 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 61B6FC77B7F for ; Thu, 11 May 2023 07:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237249AbjEKHij (ORCPT ); Thu, 11 May 2023 03:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237387AbjEKHig (ORCPT ); Thu, 11 May 2023 03:38:36 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 191101BF7 for ; Thu, 11 May 2023 00:38:32 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-53033a0b473so2905309a12.0 for ; Thu, 11 May 2023 00:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1683790712; x=1686382712; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=x7hXZMUPWRjY8wKrXSum3a8Vv4iQpiFrqaJQAhmfx54=; b=UEqY9Ryhj4OfHaBompR0muJ/4hF9xG1SXIe422x1XKrJnQRUNfN/YIRopEe7avBwss 3CODwZBOPPcRLKjtrs6o5vFYw5hPvod3+jVR1XuAMnbMxsJslbFmnBok+s1MDd027/Tf hT/XSmSWn3Tc8yuZceJTlDZ+zLqsuevukLSaM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683790712; x=1686382712; 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=x7hXZMUPWRjY8wKrXSum3a8Vv4iQpiFrqaJQAhmfx54=; b=SIKM5Oft6TRJc6zI/D3Cn14Q/HbsmwbjZ9toCfoyc8dbcvJCQlPsmlM1TJlPd13WWk r6y4dwXwJlruxLkwBLvgXR+hUo1/KFN9eYPlEn7US8G14njiVEJIgjDivh/Wmzv6KPUz QByO36wAnlGFRnOmqWurGGRN40+EzyDHCFMKD6Wdx++pxgZ2m5IJpmyi8kx7cGZ8F1Z7 JrdKe0c29PPY4q/sXppmcseDMXeijo4JVA+97NkfGQqOQo0GEkB+fUG0UrpaKn9zsG+3 AxeyLY+MaovAJg+Zdegaqe+hK+seQJpuKyBKM/rp/ZTk3V4EptcPtT+fStxXAWPu07SK BD3A== X-Gm-Message-State: AC+VfDyaomz3HEf+28uE+fw3hlNuc0HZCC/hUL3tG8x5NXKWJkEb/RtH OnJ8nbX/IbQpSUHSGcHzVpLWCw== X-Google-Smtp-Source: ACHHUZ6nCxmz48usZbfyII+7lxc0FOYBaeZpagbx4LHFQ3GbckwWl6olcdwwJGqpqQpnrCFO/i3Q+w== X-Received: by 2002:a17:90a:5644:b0:24e:358a:2c6b with SMTP id d4-20020a17090a564400b0024e358a2c6bmr19520357pji.40.1683790712265; Thu, 11 May 2023 00:38:32 -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.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2023 00:38:31 -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 05/10] RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid Date: Thu, 11 May 2023 00:26:20 -0700 Message-Id: <1683789985-22917-6-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 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; }