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 66CBEA034E; Wed, 9 Feb 2022 20:21:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5DF54271A; Wed, 9 Feb 2022 20:18:27 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 8598A42714 for ; Wed, 9 Feb 2022 20:18:26 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id on2so2989808pjb.4 for ; Wed, 09 Feb 2022 11:18:26 -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=WXvzFA0RNdEfofLVqgYAwuy6fLhUuIdj1zv/3rTzvWQ=; b=cUF5ADhGUxp5znxXCm6Kqqmsq5gGIed3xRH95WrJzzszanTOC8GO24yeCqoj4dKsRo lOLVHFt0CgEBcvqycfpEM7jZTuoczohz5dSOU3tLOA2LvOWcUNaK0KOklg2c3nfQHVK6 whoX2XKH8GK6Vvruv3hSD5mCyK5MoXP3kI9t3g1FWw5UAhsuDJToppEpOWqZaGSDoq3j Ypp1YURC8G8Q/zKCg9H6M0R9fzmXY4l1xQgadhRCvhY9mRQOxn0PdUTJiqp5rtM7+8Jv aHNaoC/E62UoIeCekWh9KrhR6y9vYlZBEBI7iwGqqucAurGJv4qW0pdCTEGAWU9tPjlH guZw== 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=WXvzFA0RNdEfofLVqgYAwuy6fLhUuIdj1zv/3rTzvWQ=; b=z6B3ewbkJZgSgMieLIhYZgUjDdIwrdHA+cJ0i1RA1WsnQOMNFcuT/AKALdQwt2qhl/ B6080FIUXHSkmf9b5axdKOZukRH35Kvrul2KEfEsIczKUJetzr+B/QurlHfcAftyokLf c6rBtBOToHrSWbzcmBluH04adaGVajhYHvQ/4rRQtyzJODltyDwtahlKU46QMVDMgzx2 MxWF9l51YPPND+U1NkAdt/AU/za0gyLr7GmrD+3q6gtrL5WzvmIJ2ZN1rR0Bn47oTJqJ B3HsghggR44fVeRn8Yo1Lf11c7HjZkuHoQk9qi3sHnaxNODskWjvBSpoIcg7BCpztKgX VBJQ== X-Gm-Message-State: AOAM530JnKPUPly1LOo8tCrC0ZoZSL9Fxtoib59UNyGKLPLvAPMdRKRA qpYEuOrKFqrrAlcYzDAi81wLhOuBzTvACW//mW4= X-Google-Smtp-Source: ABdhPJwJvGY+pvJcxLxeUMN5eLPsBuXb1I1KswU9/8VA5zdWBQuH4I8I+mah56b0fI/cmvg1+aOcLw== X-Received: by 2002:a17:902:6f10:: with SMTP id w16mr3897960plk.142.1644434305445; Wed, 09 Feb 2022 11:18:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:24 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiawen Wu , Jian Wang Subject: [PATCH v3 28/36] net/txgbe: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:40 -0800 Message-Id: <20220209191748.377729-29-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/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.34.1