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 73251A034E; Wed, 9 Feb 2022 20:20:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20D38426E7; Wed, 9 Feb 2022 20:18:18 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 5B58C41157 for ; Wed, 9 Feb 2022 20:18:15 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id k60-20020a17090a4cc200b001b932781f3eso148324pjh.0 for ; Wed, 09 Feb 2022 11:18: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=alwEG27HDRWdu0QiBzPZ2dXqZDRGBKIf7q7mpXiVIYk=; b=KJRRt7NarFGPGhzWVkSrTGyqLx+saJDzTK9PWf2ax9+sYWydA+BDweQ7geFdDpLY6E i7cMWwwH0hNsNlV4hQZMJZiEb9u5+SIb0f1GUIdmVvrFLsFgvUrYnpMfrQ8op9rghiL/ m9lQ/4da0MEbFX0CHs9FREPB65h0TquKktPvZ7VTgJNwkFqrVZ7rSi85v8YcXDqo0272 HX6ZN/Gp1E6jhGp/o4DxPd6B7j8/zh5bRRoJT5i51BtD2ZVoeSRb86a92TEBXwwzM8GS V6KzmxWNBHRRZRUCycrAG4cyy6JoEY0n0S3OtkZbkGzvyGbxsZ4xVbK4IC+64NmGiem9 x9qg== 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=alwEG27HDRWdu0QiBzPZ2dXqZDRGBKIf7q7mpXiVIYk=; b=EWNRSOFatVTZc02eHP08CAT7RWUNURetXIjNG9oPkwIQH7ZuOVOTZjALyMDnW/jNao RAURtIbTbmWuMGf8kqNSsvbiLT98C4PzXWXOGrTsD4QTxVaoEABCysHp9A+eYg1U5pQm FCWkg/WPxNUQwZeZAxXioVmRov+wz77g34EwoOKvw2KVPlK8GEWTPhdTV4czrARwE9Or ++iMD5+9Qum2wJEDBvsNuKdmh+7xQYM9T5mceMqTROd6h0+AzSFNaV0Kmg+n0/SlYqlL 4yMjVPGT2ZmABioCsIpahjT4ETqA1vNmySXxG0vY3uDpBuIFQ3sycQZ4Ybn1AXvLXcvs B4oQ== X-Gm-Message-State: AOAM533XmBx43kfQKEfiANkouCVD48JfyFf4A/wVvYCpLTYMo+//r1Fb jF+qxJnQexfZOzQGs34c29SpmZXWzaeuDl1gyZc= X-Google-Smtp-Source: ABdhPJw7hU2ztGY5DzYJE3I3O8LDdPshFHXNmerm831SbwdCOSGdiifR1phs/lrq3Kk3iqgcYT9KMg== X-Received: by 2002:a17:902:c404:: with SMTP id k4mr3650599plk.71.1644434294322; Wed, 09 Feb 2022 11:18:14 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u16sm14378401pgh.54.2022.02.09.11.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18: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 v3 19/36] net/ena: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:31 -0800 Message-Id: <20220209191748.377729-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209191748.377729-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-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.34.1