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 934ADA04AD; Mon, 24 Jan 2022 18:51:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFECB4291B; Mon, 24 Jan 2022 18:48:20 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 46C4742903 for ; Mon, 24 Jan 2022 18:48:17 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id u11so16309011plh.13 for ; Mon, 24 Jan 2022 09:48:17 -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=uq4mzrlmF3RpJdeURax9LN0/y4tfKaEL8B92rJsdSgA=; b=FDzTxkbGPQ+JWE8WEeSc3tkROCpolkjmlU3pBPWSRxz8DGUIwxterJb2Fi+hbFD5AX c/qie9pvx2hWkqPuD69IZJuaI4+S9iBg+F2KDworP9viJ0ppM8jOuQ9soHqWRQMijCu5 4V3MzM+90Ept94W9bWciS37n2OeBdPWLLoDDoyhSpc0suTAq6B+eSIut1kRo0oalb3rM FaXSiUpeLIEIM824QmEd7wv9+B6/JUPApF2m1j75xOZps07pgauadouDbIfcwmpJPMDr GwWeetC50gTzckVMiMq/Kasc2NPqvEHwdvblFCPaZiVO9GutuPZYP1AslqZtUAfhGiPp mVDw== 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=uq4mzrlmF3RpJdeURax9LN0/y4tfKaEL8B92rJsdSgA=; b=MNxVss1YyxB2bAOTYe8BJhEYhu51cu8y1sesTNFww/MDMSzXw06ehb4YXURJbV0+jO Win9PhCuJV7HCQ6Sbfy0hg8Z6lDxwHyhaz1qGZb5NIkm7Y5R6ysrjACJIw9b2yZtm9qK biDWb1WrXMGUWScAmwPPrfNVmE4FiWRUmE/oox05J7+f8TeE5FIdNctEaoJuw8owsB5g ug2bhZOsQ6qlKXPA1ykeCyF9goUeQKSvtmRDvMNQPERC4WJsg1i+AGGaRlH7geR5UKA0 fb2/tQkTXTupzQ87KRlPqKDQVKcbE2CX9zT2pNw+JSbcOHqHYypzrt6B6rFnVL3EbTw0 iFkg== X-Gm-Message-State: AOAM531/eucJS1UbxMRWmwzcCUONmS64MYaeYCso175DHGOSWwAw4OHz DqewL+nQjpE5e1oj1yzpnyPmY1JbCImpVQ== X-Google-Smtp-Source: ABdhPJwUB6RAfd94ZloIAA92wF+V39eYYFmiRzJ8ReMEnpqLU16AfxXKzQo8ogE4lzgo0JVMIJkr1Q== X-Received: by 2002:a17:902:8494:b0:149:8a72:98bb with SMTP id c20-20020a170902849400b001498a7298bbmr14701950plo.0.1643046496323; Mon, 24 Jan 2022 09:48:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou Subject: [PATCH v2 50/83] net/hns3: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:46 -0800 Message-Id: <20220124174719.14417-51-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/hns3/hns3_rxtx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index d240e36e6a86..8a428f88f48e 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -86,8 +86,7 @@ hns3_rx_queue_release(void *queue) hns3_rx_queue_release_mbufs(rxq); if (rxq->mz) rte_memzone_free(rxq->mz); - if (rxq->sw_ring) - rte_free(rxq->sw_ring); + rte_free(rxq->sw_ring); rte_free(rxq); } } @@ -100,10 +99,8 @@ hns3_tx_queue_release(void *queue) hns3_tx_queue_release_mbufs(txq); if (txq->mz) rte_memzone_free(txq->mz); - if (txq->sw_ring) - rte_free(txq->sw_ring); - if (txq->free) - rte_free(txq->free); + rte_free(txq->sw_ring); + rte_free(txq->free); rte_free(txq); } } -- 2.30.2