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 6664BA034C; Wed, 22 Jun 2022 20:52:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5567B42820; Wed, 22 Jun 2022 20:52:07 +0200 (CEST) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id BBA0E427EE for ; Wed, 22 Jun 2022 20:52:04 +0200 (CEST) Received: by mail-pj1-f42.google.com with SMTP id h34-20020a17090a29a500b001eb01527d9eso312279pjd.3 for ; Wed, 22 Jun 2022 11:52:04 -0700 (PDT) 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=DbJbymnYBvGDYjOg7pEpXUgzC8QJr6FLIKzsdpSh2wM=; b=UEtFLGR1LrR/0fhBGlBYV0/vycQMJ5nqlvHF43In2nMYckZUT1ITEWpNhsm6JHiJm1 ODKgME5unFtHRNfiGWDm7hdJnETP5sDy6uwYFOT44fzwl659bOIRdvwGQEz4+Kd6Ipyp HQEhbVeqXtQhdDXKAgIRgHpZ3nlGltmj8yvVD/C03C4VMA3dDdlXv5PeFIsdkxlpjzTX oNqWkh7fCO07bt85bcOBG22DcwXfjyqfv1TqX0kUukR8ePy9pweXUIk0/Y2pG4guEZp/ Oa4a7uZpRz8reaO4A9GPCUnf8fi3m5HHEo1MVqdeDPWeSIaJDRU5gPC1g318ZiMZTwlv I4HA== 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=DbJbymnYBvGDYjOg7pEpXUgzC8QJr6FLIKzsdpSh2wM=; b=FxeZUes/llinDAjHJX1ELGDFeRFglkRqlHyg1i8nvY/tv1igxOjIMGu3rhoxz0tybk mFGlRF+2YPYMHtdygxp/CWGQCqWwKy7YGsT8/1FE26Wx3qyl7p7afjD9cLmyXCrQd2bz 6ScUmyBDz97o2oEsaRJgkpEfVsrhLeJ9QWliVe5teRi9oLjAXd3+DIwUdwljKe4ET8PN j1onifrnS40wDmet+IwY9NR7XRbPx/DVNfXLhEjnN773z0kjsynquD2jxTXVsl/X6VCi qPr4NhTWOgB2Bzh7uATE3BVF3uBGZvAhn3AXgBn00It08g3DrD6enWZILmjK3pTt13Ug sOHw== X-Gm-Message-State: AJIora+CT1DhuZjc6utwICnFaP0HBpUkgvD+Hz5riN78I7pv2Bsi550J 6rjbd6+6cdFnrrqyvjc/4qcGphfq+pM1NfgC X-Google-Smtp-Source: AGRyM1v4clXobR5YPj0dJ7vASvRVnQmg6u1KTFoG8HJO7ZT87XQB1Oa5ZsQ/wowEEngvJqqt0cZ7rg== X-Received: by 2002:a17:902:f710:b0:15f:165f:b50b with SMTP id h16-20020a170902f71000b0015f165fb50bmr36325489plo.158.1655923923765; Wed, 22 Jun 2022 11:52:03 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id r6-20020a638f46000000b00407e25d4527sm9215817pgn.22.2022.06.22.11.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 11:52:03 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Gagandeep Singh , Hemant Agrawal Subject: [PATCH 3/3] dmap/dpaa2: remove unnecessary null check Date: Wed, 22 Jun 2022 11:51:58 -0700 Message-Id: <20220622185158.397779-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220622185158.397779-1-stephen@networkplumber.org> References: <20220622185158.397779-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 The function rte_free already handles being called with NULL. Found by nullfree.cocci. Signed-off-by: Stephen Hemminger --- drivers/dma/dpaa2/dpaa2_qdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index a93a60565df7..0500e8c22590 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -1404,11 +1404,9 @@ dpaa2_qdma_reset(struct rte_dma_dev *dev) /* Reset and free virtual queues */ for (i = 0; i < qdma_dev->num_vqs; i++) { - if (qdma_dev->vqs[i].status_ring) - rte_ring_free(qdma_dev->vqs[i].status_ring); + rte_ring_free(qdma_dev->vqs[i].status_ring); } - if (qdma_dev->vqs) - rte_free(qdma_dev->vqs); + rte_free(qdma_dev->vqs); qdma_dev->vqs = NULL; /* Reset QDMA device structure */ -- 2.35.1