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 0E907A04A6; Mon, 24 Jan 2022 01:11:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 072714292B; Mon, 24 Jan 2022 01:06:39 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 8BC2642917 for ; Mon, 24 Jan 2022 01:06:34 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id c3so13927123pls.5 for ; Sun, 23 Jan 2022 16:06: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=3xQB82pDVCLStvS40zRK/t4hyC32t5+bJoM1P8wqznc=; b=hZb9KJfqzi1TcMrc4sCQyvi7xWxyHSRL6DkhEH8OiA3q54jG4Rw01xSGVVTlMf9Ob0 NRurHDGgEWAvGCrR7KAE+ZmtwA4EHbX3ZBMjYI/UDvoshsrcxzZqg06i/c6jp+D0CwJZ V5bBHTWNjMkiC02iPkjT5JOXuz4pZBKtFw1NnHuTmU70lKv9im/08L/HhDVOELB/jx9B l7ObGG22TGAxv8de+NqKKMq1jPQB42n03iY1G6DAPZfXV826I4/SgRzlXXKVSDBEM9J3 7CPU/6Y700f7fcBvV/P9r5H2zwqrFv/5uzKlqWkjlLrugXt/oYX0E04y9AqUgqYy3Wiq 17/Q== 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=3xQB82pDVCLStvS40zRK/t4hyC32t5+bJoM1P8wqznc=; b=TbQqLGUkxWslR9jgkPB0O8q/U63z81m3mDMGysQDjLVWiL8SeaS7YQlGZdPzPmisJU lEudLczmASy5M63jhw6593JP1J964xh/Bqdr5sTgd/mFJSkTkxqDUf1PRobEfWUpPXaU 67I20d5uFwl6nloxsRh7228GmM0NJDEDmX9lALkXZa+9R0BLNWxnr+FMqAkIYgc+kW1Y KkevYilBWorEACfO154MtQDLUZ3VDJpm3aZ7vQUTH2m2UyTfrb0Blm947irws8fl6U/9 A6ZHJhILm4QtKwYhHRtp/AbgZEgxmfwtO/J/GQhWGsBbX0AHbIZN6RNfdFqxd+VhMy8N F+4A== X-Gm-Message-State: AOAM533Ilw39PD7D7tmTs+QVo8t9lYbwbTB0RaV8sefGmn/f18yprp/c b85gLAkIm/H8iw2r0asjok9s+Ph9FVUmVQ== X-Google-Smtp-Source: ABdhPJwgmO/o1F5rETb4KokD5VGTAANvNqAT5TVBFF2/hzJ7JnlLcM7xsCMIjSvxqpiLJENSq0fumg== X-Received: by 2002:a17:90b:702:: with SMTP id s2mr10679100pjz.117.1642982793562; Sun, 23 Jan 2022 16:06:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:33 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Nipun Gupta Subject: [PATCH 69/82] raw/dpaa2_qdma: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:05:05 -0800 Message-Id: <20220124000518.319850-70-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/raw/dpaa2_qdma/dpaa2_qdma.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index ebc2cd5d0ddc..b2260439a4ef 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1115,11 +1115,9 @@ dpaa2_qdma_reset(struct rte_rawdev *rawdev) /* Reset and free virtual queues */ for (i = 0; i < qdma_dev->max_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 per core info */ @@ -1314,8 +1312,7 @@ dpaa2_qdma_queue_setup(struct rte_rawdev *rawdev, if (qdma_dev->vqs[i].hw_queue == NULL) { DPAA2_QDMA_ERR("No H/W queue available for VQ"); - 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); qdma_dev->vqs[i].status_ring = NULL; rte_spinlock_unlock(&qdma_dev->lock); return -ENODEV; @@ -1516,14 +1513,12 @@ dpaa2_qdma_queue_release(struct rte_rawdev *rawdev, if (qdma_vq->exclusive_hw_queue) free_hw_queue(qdma_vq->hw_queue); else { - if (qdma_vq->status_ring) - rte_ring_free(qdma_vq->status_ring); + rte_ring_free(qdma_vq->status_ring); put_hw_queue(qdma_vq->hw_queue); } - if (qdma_vq->fle_pool) - rte_mempool_free(qdma_vq->fle_pool); + rte_mempool_free(qdma_vq->fle_pool); memset(qdma_vq, 0, sizeof(struct qdma_virt_queue)); -- 2.30.2