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 2ED3CA04A6; Mon, 24 Jan 2022 01:11:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B6B642917; Mon, 24 Jan 2022 01:06:35 +0100 (CET) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id 94777428FC for ; Mon, 24 Jan 2022 01:06:30 +0100 (CET) Received: by mail-pg1-f178.google.com with SMTP id j10so1503804pgc.6 for ; Sun, 23 Jan 2022 16:06:30 -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=E96ft4qyO/eqoKsfrx/yiUbkbGpU8voQmEFSYUalvxw=; b=0qzc6tYBUDvGbX0d7IjTXJGUbbrHfxajx+iwVi9yQbB/v8geG0rRDNT/WpSaIqekMT Z6LUgbNWOhEHGHYzu5NUtc5Eglbj+NETyFVqQT7LVyGwb81F41ZdotczgPu4B5HgGKzM QZDyKGn5brpQlO6PWJkEQcG8nsbbC1tCA5F3y7Lm/rkaLr/fZb0tRzN7mh126/1WmrTA x6JFPvnwhbSktUfM5zA7LHdyJn5+CBHrEqQfIR8xEZMEy97g8kALlVpUiWkhjaXqMkSt Yy3RAj20obqm1J9KT2TW35GnlEN5XnajWwq7PqAOZFu5BV13waLze1h1F3hpyJ3Gv/3A NQBQ== 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=E96ft4qyO/eqoKsfrx/yiUbkbGpU8voQmEFSYUalvxw=; b=mgRDuxfOmMM+sMbUDTSW21fQZImH+kuHvfsm/z7sEGZPtMIW2rhYFAo6llMmC5vewP ifW3kLT/NYsV7POxMWCzspcPueWjAR2q/EznkMMqBCPfu3E5Vu4tM64HAigjUfbhHLb9 u3ybdLSl2xdJmTcXdwv/8eYEbuuZ6n513YrnfQMrIW0AyTh6WyrayHmmmgLsRi7+8Se6 j0Jrfk9Q37BtD/Don2gUcq8fUgzAF9O72k/sMIR/q+EaSBexJgyV5CkouWgRY9Rmikrg j7iu1ZL4b05vR0/MZA0quqYkFtj+bBBaMEuGdwh2n04ptgXmkgEXBOtCH7U2I6MwqnrP sdgw== X-Gm-Message-State: AOAM5327M7RqbJ1T7x+BLbsKtUbpjDDCSpJ4OzDhbIo4FFeHOO5rLJKR CDPBwnIo2ZdgtIBoGiwgfNsu1ro+hq1d2A== X-Google-Smtp-Source: ABdhPJwqMUo1+jf3uu6NQzZGM+MXuDKnXJfp6e1R6utju7P6XB4UsGxrIbJ3N54azYsMxGIiVUvoYw== X-Received: by 2002:a63:6ac1:: with SMTP id f184mr5717409pgc.455.1642982789574; Sun, 23 Jan 2022 16:06:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:29 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiawen Wu , Jian Wang Subject: [PATCH 65/82] net/txgbe: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:05:01 -0800 Message-Id: <20220124000518.319850-66-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/txgbe/txgbe_ethdev.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index ac4d4e08f407..6024397072c8 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -821,10 +821,8 @@ static int txgbe_fdir_filter_uninit(struct rte_eth_dev *eth_dev) struct txgbe_hw_fdir_info *fdir_info = TXGBE_DEV_FDIR(eth_dev); struct txgbe_fdir_filter *fdir_filter; - if (fdir_info->hash_map) - rte_free(fdir_info->hash_map); - if (fdir_info->hash_handle) - rte_hash_free(fdir_info->hash_handle); + rte_free(fdir_info->hash_map); + rte_hash_free(fdir_info->hash_handle); while ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) { TAILQ_REMOVE(&fdir_info->fdir_list, @@ -841,10 +839,8 @@ static int txgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev) struct txgbe_l2_tn_info *l2_tn_info = TXGBE_DEV_L2_TN(eth_dev); struct txgbe_l2_tn_filter *l2_tn_filter; - if (l2_tn_info->hash_map) - rte_free(l2_tn_info->hash_map); - if (l2_tn_info->hash_handle) - rte_hash_free(l2_tn_info->hash_handle); + rte_free(l2_tn_info->hash_map); + rte_hash_free(l2_tn_info->hash_handle); while ((l2_tn_filter = TAILQ_FIRST(&l2_tn_info->l2_tn_list))) { TAILQ_REMOVE(&l2_tn_info->l2_tn_list, -- 2.30.2