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 62A25A04AD; Mon, 24 Jan 2022 18:53:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 66FFD42975; Mon, 24 Jan 2022 18:48:37 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 070E042969 for ; Mon, 24 Jan 2022 18:48:35 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id c3so16315980pls.5 for ; Mon, 24 Jan 2022 09:48:34 -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=z1pLjzhASBAMWjPj63GMzngvme8dwDwU3Ceb+W2fXyZE+x7ghcK75JHVNW7G4RCBDW WIjTfAdg+yAxAl+kU+ug0zB4GsPYFGGlboHKCGoqaFcrLlUtDg68mdcLydXq8pBGZ0Et W9Z5YSfaWY1VyMS//JBM7+9TeU6Z+DVaSAtGihUuWUrQd+6ZwndsFcWkfYWjn2mXG5TN A3r3ERJWRGMzomzpcOoCkMMUJ41r0IvCJs3zGpONelP+RoCYelMO0wjUyW30DOamxTCT WWaNf40uz/l3X/INmKkhTiNv9bDA4tTcU1spMugdyiL2levlONJjUKmLhB6LZlvCLhFJ YHNg== 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=siPmrJL328Szi2kdSFZpdvCOXg9f9z4QXL+dMiNgFumh7fK3U4U0eon6zr1V6sC8u/ 0zYPBSMrEGuCzfT5yjqEGUBXaTnAQNLrLSD33VrvW3qPdCegi7R0M9dGo19f5WqCnQZz oFwMgRYwIO8qzHzeQF9fULIr8ic1p9ur6tdYm4jpm0eR9OoGsNVDwmHGC3MB2lLcSeZv Vzeu6L7MtE6NanFix2LnOdSOBxQVeMxo8b2VKe6n1O3o/qS5m+9gxP7UM8xS32XnpbG+ 0Y2He+WkBUS6zb+sBco7kvfTQJsDymPw386yHuGoJaThS770CYezprHmBgfxKpcEFaOT FDbQ== X-Gm-Message-State: AOAM530aUiS7AzZnEXwxfzl2dqd2VJjw6u2wzqa6GtD4h7ovZyA5b5DH ESgfIMAR7tj+DEdoJvDkPIox7MKvQLhHCQ== X-Google-Smtp-Source: ABdhPJzckJkoP/KkEvsthtGBasXgSmeuW7c/NHALB9jwHPdlV1fhuJ37/AR8UHx36g5f1dSYRRqDog== X-Received: by 2002:a17:902:7c97:b0:14a:62ed:c296 with SMTP id y23-20020a1709027c9700b0014a62edc296mr15192102pll.42.1643046514027; Mon, 24 Jan 2022 09:48:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:33 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiawen Wu , Jian Wang Subject: [PATCH v2 66/83] net/txgbe: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:47:02 -0800 Message-Id: <20220124174719.14417-67-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/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