From patchwork Fri May 19 06:48: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: 13247727 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 2DE14C77B7A for ; Fri, 19 May 2023 07:00:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjESHAU (ORCPT ); Fri, 19 May 2023 03:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjESHAT (ORCPT ); Fri, 19 May 2023 03:00:19 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8136A10F4 for ; Fri, 19 May 2023 00:00:17 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1ae851f2a7dso1446355ad.0 for ; Fri, 19 May 2023 00:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1684479616; x=1687071616; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=X3C9lFDJpHh1oeM62w4yBtDTFuRJtiBA6uv7+35WM4w=; b=f1SogSv1AEeU3y70HEKvqNBr00pWFMr/gDRVhykwi5jKbZ3OUKiWFGs65dI6PVDc2A 1FN17vglw5Q8UpE2PHCdZMnV+fmcw0tczpojEA0xCvgRT8Nd/Ibz5SWSUu4uuYmkG2sg Ioe2mh7ZJhj4P0UHnjnfM8q4FTG6OzvK+Jvvw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684479616; x=1687071616; 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=X3C9lFDJpHh1oeM62w4yBtDTFuRJtiBA6uv7+35WM4w=; b=IiU+On4RRYifmmoh+zSXE+agyHTxiAZS7QxL6VqGj3El0IUK2YIpiEeMdhr0HA0OCG COfGudot2xmUWBDPpKZatj+eibP8dEmko6141pJjEpXAEnjOl/ixiaIYv63nNC03SzuX pJG0ME0SkWMkBX7tlJRpPB7jRm1c5TQQtcwwCbnBbGfYuVFatinVOnZN0G5wmHpoe/m7 IW5tzdGT+aHP5ZUof0zJ0+nhgrujwk/Uotjde0yCKjEc77qLgaIxmIEIRoyI6sxyB2pm EuClYCOHXzJr7mHDitimJYK6kI3Vsv+SMDha9NKsg0bZgwcJ42xh7BWZUVkz1ehMD4GW 6ucg== X-Gm-Message-State: AC+VfDzCn0NdusouzbwyYVHtQz+lhjElUOe/xMclicA9KSe+5pSa8u3N YPOQkEG6FO2fqM6mJA1n5+wsNA== X-Google-Smtp-Source: ACHHUZ5S8WVzx2QS3P+5t0JLpW7j03+QhUIx3d/9oGCcPrSBdaFbgY8Enb1WdsKsOXNThKOkMinbJQ== X-Received: by 2002:a17:902:d2c6:b0:1ac:9efa:bb10 with SMTP id n6-20020a170902d2c600b001ac9efabb10mr2098138plc.4.1684479616261; Fri, 19 May 2023 00:00:16 -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.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2023 00:00:15 -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 7/7] RDMA/bnxt_re: Remove unnecessary checks Date: Thu, 18 May 2023 23:48:17 -0700 Message-Id: <1684478897-12247-8-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_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 1714a1e..dbb0e4e 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");