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 9F71EA04AD; Mon, 24 Jan 2022 18:51:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A133428D6; Mon, 24 Jan 2022 18:48:11 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 9B4BB42886 for ; Mon, 24 Jan 2022 18:48:07 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id q75so16026994pgq.5 for ; Mon, 24 Jan 2022 09:48:07 -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=Abc8Vz3cPTBVat7rAfJQZ+YehfmiWbb/6QAR2ZO/2lFRw5AToKPQ74xmTmj9cll3Ug dv7cuLUO/1hETonHWbC6vDQdtoon3oHFHOW6vz4luLk++6OpKLx2uPREHQdP+gBloXPa LfhavgNelWL4N2MvjJJgknnzHe3rtaMKgk7Qcay12140XDVjLBSHBgmsFAtJSUlK6db4 A0YE5TFKYjV2SaPJvJFGbE6HkCUmpyHnATMjAHHmRwIYSdOOjkb1RdZIIfYhj2kqwUOU ggmOIv80itNZybuCs5zU8gY1s4JzKqMq1/4vJICFS7aoViAVDvHd9NyjcWKEp1CbwLi9 a6vg== 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=Kyfi8fCByILi17V3UnU/nCZH5gk8MJBsEHkhNNTkPWdt7DSH8fXu4AXj/M2KoBVi0O p8aH1gomxNVDpMYz+sKFlaTAeEJF+bnxk7lx/zUSvUW7xWpF3kK2Tw0H12FvehhPva4o zTCrONdJ/opdjovj3xC+gXV9ag4A2SrSTsYrw7hgVnBzgDpaZG7cEO0/6ZDlVPtOVcUX R+RUd+bo6cKczA1bJzTz6sJu/aN3z5fqyPHe0BaQnuBTrFTc5zE6bEqO0cnY9iVXhOF2 NOyzm6+J8VvAC9SBT6JxRlKeFygiGhPUHSVpGwwIhVxSaEqXuVS+KFkvjwXjpsmVJFc9 IPmg== X-Gm-Message-State: AOAM532/sY3KrCfTfzoVM/Odht7lm10Fw6CASEg9aRHDd1yTe5By+1rC cXx6RGcBphzjeRvMwhrKituf5I8KxFA/sQ== X-Google-Smtp-Source: ABdhPJwUDWG2j7CpPVcwVROnWMaaXoJ2Uav6oVVEeq9aiPi7seZx6yzUcdRRXp8bm5Sdqrzoc967aA== X-Received: by 2002:a05:6a00:18a6:b0:4ca:38e0:400d with SMTP id x38-20020a056a0018a600b004ca38e0400dmr2055496pfh.22.1643046486638; Mon, 24 Jan 2022 09:48:06 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q7sm15835082pfs.37.2022.01.24.09.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:06 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rasesh Mody , Shahed Shaikh Subject: [PATCH v2 41/83] net/bnx2x: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:37 -0800 Message-Id: <20220124174719.14417-42-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124174719.14417-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-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