From patchwork Thu May 11 07:26:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13237594 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 3C504C7EE22 for ; Thu, 11 May 2023 07:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237271AbjEKHiv (ORCPT ); Thu, 11 May 2023 03:38:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237508AbjEKHis (ORCPT ); Thu, 11 May 2023 03:38:48 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABBA1BE9 for ; Thu, 11 May 2023 00:38:46 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-51b4ef5378bso7335110a12.1 for ; Thu, 11 May 2023 00:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1683790726; x=1686382726; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=xyU+hk6fVewzu+QBuUlV8Ef6UpUkuf0tvhAPUbS+XW0=; b=GJdNXZHFtqH2cSvtF/vxC62FP4MfdMlcjDCsR7PIMXu4CFFxKqLnMxI1DX58bMny6C s0InaIlJJOnCiDPqJsJbCzNXW4Ad83Nu4IWpbYoRGWOEMUlBVjnk8RYTo1bV/EPMS8q8 tPlgQ5D+z0j2hoyY0nH6u/PMHXLygmNJvZ6Fg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683790726; x=1686382726; 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=xyU+hk6fVewzu+QBuUlV8Ef6UpUkuf0tvhAPUbS+XW0=; b=PeRw40IDnDr4jtF4glx5R8QEG0Zd7qtyo5qtoBdhHSHFFkZFd50LQcsqw7b1Q/0H+/ g0vykH639okpAA/jhkIMTrAGpxlvccDeng2c3WX1UJ6TqaGoKShPoB7EV0UbOYTaB5zz 9+wqk8SIp0ReAF0eVrszWhcBltChF8jBzHL8kNws028lOJ9Xb42LslOSMdiDFc1N7a8y svBmZTx5W+uGuqRjkp6ElD+pJglDimUIfhKNbTUvcq4r9rvI8CYFgBoSGnXgIRIM6eXU W8xg0Ci5yJNA6RO9JpyrpeN2pw8T78P6tz4cF38di7irTtKTI037VULOUMcp1jKtfMBp e5jA== X-Gm-Message-State: AC+VfDwVR81qAmz24+KuATy7RfpVPgXSrj4Fk5Kux9TccbGOcm6mgRvT C53rEOFWwX2n3VqGlBej3Z9VbxDe15Ph/7QGyMU= X-Google-Smtp-Source: ACHHUZ7jQQAttYVFET3BPkeqRDNCUg9x5sAge0kclWqFuvudrekBt+gbKyr3HA/UGWzLKXBN0h/JWQ== X-Received: by 2002:a17:90a:e645:b0:247:35f8:81d2 with SMTP id ep5-20020a17090ae64500b0024735f881d2mr20227935pjb.29.1683790725887; Thu, 11 May 2023 00:38:45 -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.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2023 00:38:45 -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 10/10] RDMA/bnxt_re: Remove unnecessary checks Date: Thu, 11 May 2023 00:26:25 -0700 Message-Id: <1683789985-22917-11-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_qplib_del_sgid() and bnxt_qplib_add_sgid() always return false as the "sgid_tbl" inside "rdev->qplib_res" is a static memory. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index b967a17..a5ce4b8 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -233,10 +233,6 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, struct bnxt_qplib_rcfw *rcfw = res->rcfw; int index; - if (!sgid_tbl) { - dev_err(&res->pdev->dev, "SGID table not allocated\n"); - return -EINVAL; - } /* Do we need a sgid_lock here? */ if (!sgid_tbl->active) { dev_err(&res->pdev->dev, "SGID table has no active entries\n"); @@ -297,10 +293,6 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, struct bnxt_qplib_rcfw *rcfw = res->rcfw; int i, free_idx; - if (!sgid_tbl) { - dev_err(&res->pdev->dev, "SGID table not allocated\n"); - return -EINVAL; - } /* Do we need a sgid_lock here? */ if (sgid_tbl->active == sgid_tbl->max) { dev_err(&res->pdev->dev, "SGID table is full\n");