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 BA1FBA04A6; Mon, 24 Jan 2022 01:09:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B97C8428A5; Mon, 24 Jan 2022 01:06:16 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id A40394288D for ; Mon, 24 Jan 2022 01:06:11 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id x37so10266380pfh.8 for ; Sun, 23 Jan 2022 16:06:11 -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=EEz+Js5g3V8LrOBQCU9G8QIGXyNA7B4fE0VPNx667uo=; b=1+mg7fDHo0p0RDzSG56PyNXiAlAzYBIbsG4++h4nJdMfceyqVB8w5ZLalzK0hDxxK/ 9lYbsWdRYpkosTJ1JWXr4XAUSsXanZLattCAkGdUH+bbj7KcRqHszXDsUubt78D595+G 7+7z9QNr4V6TIvRZeMMKuxxn0VoiW54s+r31Hh4KlUGOK+gTQWz83hPR1HoqJeZu7zx0 q2asowBQNLbv+TeSeTttoOvMiDkkBiCa0N0tOJBQFgbkwcmKznIeh8k0KhlJRKE68sa1 FlIEahqyWdZkGEbXYw4DVMW96z5DAm1t6qu+nwuakwwsPbaLjjXUMtvV1c99I+vKfOqf RuWw== 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=EEz+Js5g3V8LrOBQCU9G8QIGXyNA7B4fE0VPNx667uo=; b=oNh4ZMFQlFeamWElxUJjzc5qi058AUl7GI7gwdUX4MHSWdPFNkm0DLKiDAsOAtAPsw f0xs2+z5mEgi7/U1QlY7PbbHRwjopvUQ/TVysaOyhTYn66gHw7ydI8BuNPujEkSBJXWJ HXUiI3nioIVwvW/668O0vZRZqi5mXS+jVoJ1sKI0TCalmuJR/nstbQoyM+qotQwAuef9 Dsp3Pi8MhtUIOKmyyHDa6zNziXZ96DiZbrk0ofQoUKWQ7iSW0YCn32SPhq0fFcKwnu1r xcc1EhvmAD6EQW4S28o8aD/cYhXjTztIPdcGLnRAcY4vUi3Klu2VQ/8mtNjlfuZexm4Y sFCg== X-Gm-Message-State: AOAM532xod79ARHn1dKp1pK8hqDfXZ9welsd+c7uqAh+8zmC+tGONjBI rB5nDSLPIz3PjQOJOyeEarBa3zpvLzkbGQ== X-Google-Smtp-Source: ABdhPJzRlLyeec3cJS2GmrMPego6bKolGfRpJt4gEoVvrnBESXX2qIu3ol3+eNmocWbnIbOkg89/wg== X-Received: by 2002:a05:6a00:8cc:b0:4a8:262:49e1 with SMTP id s12-20020a056a0008cc00b004a8026249e1mr11698216pfu.28.1642982770698; Sun, 23 Jan 2022 16:06:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Marcin Wojtas , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , Igor Chauskin Subject: [PATCH 47/82] net/ena: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:43 -0800 Message-Id: <20220124000518.319850-48-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/ena/ena_ethdev.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index dce26cfa48cf..db2b5ec8e77b 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -567,16 +567,13 @@ static void ena_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid) struct ena_ring *ring = dev->data->rx_queues[qid]; /* Free ring resources */ - if (ring->rx_buffer_info) - rte_free(ring->rx_buffer_info); + rte_free(ring->rx_buffer_info); ring->rx_buffer_info = NULL; - if (ring->rx_refill_buffer) - rte_free(ring->rx_refill_buffer); + rte_free(ring->rx_refill_buffer); ring->rx_refill_buffer = NULL; - if (ring->empty_rx_reqs) - rte_free(ring->empty_rx_reqs); + rte_free(ring->empty_rx_reqs); ring->empty_rx_reqs = NULL; ring->configured = 0; @@ -590,14 +587,11 @@ static void ena_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid) struct ena_ring *ring = dev->data->tx_queues[qid]; /* Free ring resources */ - if (ring->push_buf_intermediate_buf) - rte_free(ring->push_buf_intermediate_buf); + rte_free(ring->push_buf_intermediate_buf); - if (ring->tx_buffer_info) - rte_free(ring->tx_buffer_info); + rte_free(ring->tx_buffer_info); - if (ring->empty_tx_reqs) - rte_free(ring->empty_tx_reqs); + rte_free(ring->empty_tx_reqs); ring->empty_tx_reqs = NULL; ring->tx_buffer_info = NULL; -- 2.30.2