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 5727CA034E; Wed, 9 Feb 2022 20:18:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80360411AE; Wed, 9 Feb 2022 20:18:03 +0100 (CET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 69A3B4118A for ; Wed, 9 Feb 2022 20:18:02 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id i30so5950813pfk.8 for ; Wed, 09 Feb 2022 11:18:02 -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=B+qPuGY6uGX+pCe3uHuUD9eSK/HeyzXg1wRKA5kPlIs=; b=EqZRnLtxZT5ANG4KeW/Dp+QTc/nCBrEuPqTSB2aLQR7pZWOwO4yTRWoenz6tMrwPq5 an/2o46A7pfudqaEg5ak0E0C0vZ14qumIVRdcT4wfoxqtIeDpQVbmbDwpGsI+Cr+HkBM XrUebFz1otFAeNove6j4lueY8ZOXKTaZWANZ1AUv5Ap2jflH7vy50000C3faM5j302RU XnMb2Ed78eeX9rMGndFhKAn7zXXdkdemVMYY4w+gOH6BW9rAnBi/vmPPNqjJUF6CKl82 p0rwwCf+nAuThiB8fbrrN1j5jO8SWAysDeXd7XTZEV36YEqw1RCy5bJzyUnJSv2Iu5XD X0Ig== 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=B+qPuGY6uGX+pCe3uHuUD9eSK/HeyzXg1wRKA5kPlIs=; b=0JY/5NF3xBDt8aa1TcHkiSNKcd5UMICI/O/kA2I7ZQ3dpTJY4rcNBUxAK9uQN8PMlC WdS6TY5ZQ+Bj9HtUoOMJn0pcecjgdg5gdWMEU8XWfRbj4XfUXZkbyXEctuRtHBDNT7hZ foqKy8pMoETDhYw3QogxSzjrvuvn8NTTBuLD4SLIrFyvmesMn0KrKpLR7pXkc8OH0yQ1 J9n0zSWwfYD8sh/5UE03v8ksRthczA09dzZEgb972Lmruj0d4qb4BZyMd4MmqTS3KW4V 0kMRTAEnsZarOr+3jS+SQ+PruEZCRI2K7RqJvBalYqClqpbMHmtVxWCSjpr8zl3e31s/ UrUA== X-Gm-Message-State: AOAM531NRnc+nxdYwOnizorXMFeaols80ZPjcN3g8vgFKCn5uj4nYNQT PEkLFxjrCnO4EMzGi1WpGYFMKiAIBkVz7Y3t X-Google-Smtp-Source: ABdhPJyKofRpqi36fmagNs0AQ9/pytxybieY2Nh6gK+LzaZVmlQnO7H/uI4jWeIyo8H2RaHKGxyh7w== X-Received: by 2002:a63:2a95:: with SMTP id q143mr3081798pgq.407.1644434281284; Wed, 09 Feb 2022 11:18:01 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u16sm14378401pgh.54.2022.02.09.11.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:00 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Nicolas Chautru , Nipun Gupta Subject: [PATCH v3 08/36] baseband/*: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:20 -0800 Message-Id: <20220209191748.377729-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209191748.377729-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-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 Acked-by: Hemant Agrawal --- drivers/baseband/acc100/rte_acc100_pmd.c | 3 +-- drivers/baseband/la12xx/bbdev_la12xx.c | 3 +-- drivers/baseband/null/bbdev_null.c | 3 +-- drivers/baseband/turbo_sw/bbdev_turbo_software.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index 1c6080f2f895..f86474f7e099 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -4402,8 +4402,7 @@ poweron_cleanup(struct rte_bbdev *bbdev, struct acc100_device *d, } printf("Number of 5GUL engines %d\n", numEngines); - if (d->sw_rings_base != NULL) - rte_free(d->sw_rings_base); + rte_free(d->sw_rings_base); usleep(ACC100_LONG_WAIT); } diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 4b05b5d3f2a6..4d1bd16751fe 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -975,8 +975,7 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, } exit: - if (kvlist) - rte_kvargs_free(kvlist); + rte_kvargs_free(kvlist); return ret; } diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c index 08cff582b99d..248e12987f03 100644 --- a/drivers/baseband/null/bbdev_null.c +++ b/drivers/baseband/null/bbdev_null.c @@ -251,8 +251,7 @@ parse_bbdev_null_params(struct bbdev_null_params *params, } exit: - if (kvlist) - rte_kvargs_free(kvlist); + rte_kvargs_free(kvlist); return ret; } diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c index c6b1eb8679cb..af7bc416f92e 100644 --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c @@ -1918,8 +1918,7 @@ parse_turbo_sw_params(struct turbo_sw_params *params, const char *input_args) } exit: - if (kvlist) - rte_kvargs_free(kvlist); + rte_kvargs_free(kvlist); return ret; } -- 2.34.1