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 D18C1A04A6; Mon, 24 Jan 2022 01:09:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AB86428AB; Mon, 24 Jan 2022 01:06:18 +0100 (CET) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id A041642833 for ; Mon, 24 Jan 2022 01:06:13 +0100 (CET) Received: by mail-pg1-f173.google.com with SMTP id i8so13594053pgt.13 for ; Sun, 23 Jan 2022 16:06:13 -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=DvKyGS3tiRlrDqa2EMzk7/KmN4z8mwi0IpkPP1kC0REgTdFSYATfRVCdOt6rs+T1Dg 0I9mmqlj+NyKb3hF5GsK3f1YoVRHoCm3cNNBewRwQmmK7Kp04Or0x5YS/rzjejGijWtJ r0M8dBmtcLJZtviRZW4AvR72wtN/67D4oOXOevvrRQNJQVlM0t3TXgjNGvi8s6mhZKq/ 7SNpyMH08PkXVv2CISDEM1XDIr9rer+7z3ys3q6kMETKzhw7CPeUHjQYTn4QmUlJzXU9 B0CJ09Rr7kldBt4Qz0a5L58KypiV0eOURNspqlvuKRSPTVTkxiTSmBBJzR8xNJevIFAz H4zQ== 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=Y5HkIT2hVHcxv29wwaCGcQh698hUGogaO1hPVHiTKw/V04g69wXq5+gObzsmIBgG8p +KS3/m6MG+/O5UW2d8KHBJ+qggAuPSb/s77hvqNy7HjI1vPFsXMN1kDpY2nofpIAL6hh IIR4Xo5OEzsEJz0gVrawaXxV9lz/legbQ6yRythMSoyhYcZ5IeWt8cZ4ewX6Of7m8Klw cmlQzVUso0Ew+9NMcgdNeWCRtfDzViPP0LWG9hjaOpqbo+8/vlFPpm7fnwhBtiwloHAH uu6eUeWO0Pnal7jzAHR9U01n61/cXFj3E7npTs+09aD6s+8evHA7bWT50dMRHNsvh7vV LtIQ== X-Gm-Message-State: AOAM532oz5WJVl5rgR5KvsaMiAIgKRflHDX/vtpcV3SZgLJY04usKrR/ fQPHWWdeO0pDTjfk0HyHOX+XnhdUPrbIZQ== X-Google-Smtp-Source: ABdhPJzepO22D1wm+54rqrO8xXOSFONOyS0XrhdnqNJBiDbUvGqFjqMXE473o5CEwPGbX8OPp5MJiw== X-Received: by 2002:a63:3d0e:: with SMTP id k14mr9860773pga.484.1642982772695; Sun, 23 Jan 2022 16:06:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou Subject: [PATCH 49/82] net/hns3: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:45 -0800 Message-Id: <20220124000518.319850-50-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/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