From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 839D5A04A6; Mon, 24 Jan 2022 01:09:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93638426DB; Mon, 24 Jan 2022 01:06:07 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 1A7DB42888 for ; Mon, 24 Jan 2022 01:06:04 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id y17so3567501plg.7 for ; Sun, 23 Jan 2022 16:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iMkK/DcRMDPcFADA5l0+rEuzH5/Li3lybppd2h3tuz4=; b=aaavHR8NVfeGBT5HmA7OP+wVIFy5KRmejQ7RMQBDoR+vxMQknT14kyVh4HYiMa9O6K jG0z+bK+/VY9yhCnYRYxveLbx0ZUtyi3JHfsNUnRmdHFW+d23pU8aL+7Rq0kGG02X2KM ME29RvCXJfvjRW0KTK/m0hdjk1JYr0u9ERQbyWOKqQRUAEyqRL5b1mldx7OGYQlwhm8r DFDGr3561vlOlX5d/P4iDYq1VeV5nP50ecf7+hPLx8f46xYiU0xovWw2Jm0xQwcs8QjQ EztVFSyqMnbHZvVdo6Ngc25SC63mjszwPTGf8Zxj4/kTrR/UL1QdC6o0vMc+PweQi80t nCAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iMkK/DcRMDPcFADA5l0+rEuzH5/Li3lybppd2h3tuz4=; b=gQTd463D8ci1u4DTVS/kZTZaALpvEO76vJ/nQB7reEOHEWJrPbS4XrBJkqmg4vbxro bwWwYZ24es+oG7/DniFKv4jXoxflSY3ImKnRVMS5oTazZOM6yS8t6i++QK5Q/T6QVugc 8RTLnaSVJ7D6SPB8SlGy5tYRIvPKNAlBjCcMKuL/QX0kRntONqFq6IdQnAmvqKABNtqt wmMV4+XeyUK0QE/QLHLhKb9A6by7/ZAgWjwTIeJuTHnU55zvdwgqbzmqfOUlVsn/vvyN Lu4t+fKpGuxMkQ4zxnsXXIMehTvBSt0skivDygUMFtKoMBG4f770wsb3ViSEx8d3xhVX KyHg== X-Gm-Message-State: AOAM530b7xd63WX8R1txjGvcqy+67xC1C22dyfF1q8dfUJ/m2IP23aVP JrFwDDbg1n0h0vjIwt1cq8jS6SqHq/3U1A== X-Google-Smtp-Source: ABdhPJxkPYZrdJ2RbUzvufbaEZKGf+TlU5Jha77cGaaZsukZzcwa1wzGGdrGE0WLrN5Sv4k+YnYSwg== X-Received: by 2002:a17:90a:4593:: with SMTP id v19mr1872788pjg.67.1642982763060; Sun, 23 Jan 2022 16:06:03 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ck21sm10935350pjb.51.2022.01.23.16.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rasesh Mody , Shahed Shaikh Subject: [PATCH 40/82] net/bnx2x: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:36 -0800 Message-Id: <20220124000518.319850-41-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124000518.319850-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Remove redundant NULL pointer checks before free functions found by nullfree.cocci Signed-off-by: Stephen Hemminger --- drivers/net/bnx2x/bnx2x_rxtx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index 66b0512c8695..00ddccf151fd 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -27,8 +27,7 @@ bnx2x_rx_queue_release(struct bnx2x_rx_queue *rx_queue) sw_ring = rx_queue->sw_ring; if (NULL != sw_ring) { for (i = 0; i < rx_queue->nb_rx_desc; i++) { - if (NULL != sw_ring[i]) - rte_pktmbuf_free(sw_ring[i]); + rte_pktmbuf_free(sw_ring[i]); } rte_free(sw_ring); } @@ -172,8 +171,7 @@ bnx2x_tx_queue_release(struct bnx2x_tx_queue *tx_queue) sw_ring = tx_queue->sw_ring; if (NULL != sw_ring) { for (i = 0; i < tx_queue->nb_tx_desc; i++) { - if (NULL != sw_ring[i]) - rte_pktmbuf_free(sw_ring[i]); + rte_pktmbuf_free(sw_ring[i]); } rte_free(sw_ring); } -- 2.30.2