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 B6AB9A04AD; Mon, 24 Jan 2022 18:53:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 993DD42993; Mon, 24 Jan 2022 18:48:41 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id AE9FF42984 for ; Mon, 24 Jan 2022 18:48:39 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id h12so17131940pjq.3 for ; Mon, 24 Jan 2022 09:48:39 -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=pchJ3Hqlv9DKAjpfXlTqmfDWM/i2PajLu8RkO/PaJ+ll/9V5pPp971o4JXjrFlh2vR CK/ofMMSKeH4KZh98JSw4PJQup/SxIdNsrMlTR1hW5/AmB4ySfdp0KgVpaq24S6JioPh 3SSWgPCuQOIs1PW7r2Ax3jyCpb+5e8B5+O5yNGzuGoYngBafnaIko4nQnWpbZA33kHY4 JjovWLJaPemTPTI5+ue4xLSmt6+E1Y240suf30V7SRFyf37ws+OrfR0cZmjiGU2ttNlT p/ZGLKSeK4DdWC4Qfkhp9AeLieHrQKJ41NUS9RPgzwC7I15qsYqIozVS04KSri5LFTv0 B8hg== 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=OI6VeGsGfgzTB6Q/XwZG+FZQ1FAMiMo5/gTs/8T9f/5Ho0G78R6hsNpGAdNC09Zj1P LaHRBkAfC5AYj0iYAkR/QkKxsxO+dUvOHCs/jp6rwb6sWH4wsTT9OWskuY39Dj0KxSXl TgaNo4zJBhv/OsNnK7P+TZpDD8Jywz1MH/15KozPwawGnqs2N/RQdzWDzuvb7NSNvL1U N7JwUDVvr32Al8VZ9FdaLaXfPIqxoAYBAv8F+fGNLXkoveQ49Fwy2YZkv2NcUJ2hgGo5 UMJra2c0PPzcLiVNDZOEEC+EmXThHv82ANgS6uJgrIKbHw2T41bDlrV39GXYpxJ2K/B5 8/ng== X-Gm-Message-State: AOAM532oE3ou9ryNyRP4MkRwhTuiH4+shU7LbdW9FxnOqpWYzVcEYMa2 7vmBcxyNk2cd3VwCS82mb/qplOT+nDxGvQ== X-Google-Smtp-Source: ABdhPJxSBTqhbG2bnHgyK/2kA5Va1odhU1+drZrApso7Uq75LrpODWvxm417mf3wZe5FY4i8mz461w== X-Received: by 2002:a17:902:d482:b0:14b:4181:abfb with SMTP id c2-20020a170902d48200b0014b4181abfbmr8007981plg.106.1643046518702; Mon, 24 Jan 2022 09:48:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:38 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Nipun Gupta Subject: [PATCH v2 70/83] raw/dpaa2_qdma: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:47:06 -0800 Message-Id: <20220124174719.14417-71-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/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