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 917F9A04AD; Mon, 24 Jan 2022 18:51:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E2FB42910; Mon, 24 Jan 2022 18:48:18 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 28D9E428F9 for ; Mon, 24 Jan 2022 18:48:15 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id c3so16314508pls.5 for ; Mon, 24 Jan 2022 09:48:15 -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=4UesXO07yNibrHG+BVwvOJrZzgxzGnzchcWm3A4MJiJU+x51FyyVJpiS555u4eVK49 ImoY9lNG6g7UBV4apa9UnCSs7+yFAb4nIcdt+C2GYcPO6v5ersG7WjMa47ftRi4TuAMp JMCW+YelF/5YSfJr0RXjc3QFVwP0uMwQzFQfXSlUzSROVFVDdZztrTt1SEosc7hua7RM oecNVIerMjTeo2ww585wHiVTFLh5gkLhMy6s3xVG8psa5XUwYRyBnmLtbfkOkI4IR8rQ IHT00f3fQNVxIuJNifWaeIdNK5pANA4gyVlD0D2S+h3gRIuMcrJbDkEjiyv0gKxr4tXo dzmw== 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=nalYaK7C8TJwFZHy0WGil9WgCysfp/Z0SM4+eZJumABccBKqctSDdWgTaAWbVy+2BO cp1+riybBYsrZH9r0joIwr/emqrTDf3lTwmPS5UGWY1P7KJGtfVMypSxTHmJXM7vG2TQ I6W16iU0z/eFh6VjZVJV5gl++/Q/tyYOGNrPNaaJoYv8vsNog589PNwhEmRr9vc8weWc H7IeiY7qyS4GQpKQ/4vqiOu0lTWGpTjbPnYB5pg3+1VcXAsxw/iviZkxqWHlYub7rcYP 3/ze+eNGCAke00/twEGYKTDSESQs4sDj95afcuT++MRD1KPp0EgjjxipbTKmn97jZKGn CKqg== X-Gm-Message-State: AOAM532Ab/hNh5Cwiy2IAQ0Awa8DGskNJRpFluE2/Dd9+mLvviI9m6L8 VXmyyN/VpzCiKSImLIXlPbByEPR8em3CqA== X-Google-Smtp-Source: ABdhPJxcidqLAofM5cRtwNOM1EFaZzfKAP+B4Sr9ij45xOcicWO3IeXHdvJ/2nT6HiAzIJod+BYlHg== X-Received: by 2002:a17:902:b586:b0:14b:6bab:55e3 with SMTP id a6-20020a170902b58600b0014b6bab55e3mr1166493pls.43.1643046494183; Mon, 24 Jan 2022 09:48:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:13 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Marcin Wojtas , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , Igor Chauskin Subject: [PATCH v2 48/83] net/ena: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:44 -0800 Message-Id: <20220124174719.14417-49-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/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