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 07717A04AD; Mon, 24 Jan 2022 18:48:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D78B442826; Mon, 24 Jan 2022 18:47:38 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 99C0C42813 for ; Mon, 24 Jan 2022 18:47:35 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id z5so2413195plg.8 for ; Mon, 24 Jan 2022 09:47:35 -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=XSkqO3NWwTKO3Hpq/cbV6nAa1Tp6L+8voA8mWYxEIDQ=; b=VAoBaxXI5kN4RQZsDFk0c/xrKJSQxD7lu+Uv9vRX2iI9Vsyzi7qvq5JGQrS5pLLch3 305RPEcs7C2SNF76jr181j4LX14WxxWQzvJ60NYEO6vOoz4y1WT4AHotrdHQjO/0rRck dPq+wMf8Q7t4/jfG3iAEi3DWIPRV9wCEINLumnC+3T7HFqvMAKKCvPDWfLkHJnkWdzfa 2IHU25ts3exncV0Fjce/Y36fdthVeJyoz18JIB3OKvTSqhFsbcGuVTRLDuKSog4uORZL QWQ/+j51ctQwZdTtLySUgwLkUFq8arHQI9IilKUB1xHAuisWMimXQq/KgJO6tVKwOegH Kb1Q== 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=XSkqO3NWwTKO3Hpq/cbV6nAa1Tp6L+8voA8mWYxEIDQ=; b=5belR5GaOAXEhQLL8Kn5sfCTGVvr1PimWjLbeQFM35Ch89RRj583HHUlrPpdc6o33n 3ljiVH4y7WI2sgZW0E7mdpQMQMqtYvJBM6acnFMXxQ/aEqnwUeW+eXsKlYKapvsA959L OEKKG8BIvQPoKdOcpNDwU+EPtyB2o5QFs9Lihl/llGRIrAnotqYSGRDvE8RdHnxr1lrj A+obQ1JT9/bBw8OA6/m/ERJAmDbqkG1FPHApjIe4mE/6JJtTrmwmf36SOq/16hsQzJg/ ibpCfqsrweF0jydCDtUmPH15J9k20QmXtapdS9JunnrNboBPIbo9lL5dLjJexdLaRM+w mB4g== X-Gm-Message-State: AOAM532F7SfTU0NlDnH3nyW9YtqIFzeYMwNtCF8UF3NaKKw16utgBra2 mN5umVDf1NPx7OSgg73WNLzCWxS4XfVQ/Q== X-Google-Smtp-Source: ABdhPJzsaSBb2KLFgEd0ucJDjiqcp9LCmvklprHAliTRuxiMIyqpLjfPXiCEbZTuVUDPf5uvZMtE3g== X-Received: by 2002:a17:902:6b02:b0:149:9c7d:3ae7 with SMTP id o2-20020a1709026b0200b001499c7d3ae7mr15283121plk.51.1643046454648; Mon, 24 Jan 2022 09:47:34 -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.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ciara Power , Declan Doherty Subject: [PATCH v2 12/83] app/test-crypto-perf: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:08 -0800 Message-Id: <20220124174719.14417-13-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 Acked-by: Ciara Power --- app/test-crypto-perf/cperf_test_latency.c | 3 +-- app/test-crypto-perf/cperf_test_pmd_cyclecount.c | 9 +++------ app/test-crypto-perf/cperf_test_throughput.c | 3 +-- app/test-crypto-perf/cperf_test_vector_parsing.c | 6 ++---- app/test-crypto-perf/cperf_test_verify.c | 3 +-- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index ce49feaba9f3..4c7bc72eb5fd 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -49,8 +49,7 @@ cperf_latency_test_free(struct cperf_latency_ctx *ctx) rte_cryptodev_sym_session_free(ctx->sess); } - if (ctx->pool) - rte_mempool_free(ctx->pool); + rte_mempool_free(ctx->pool); rte_free(ctx->res); rte_free(ctx); diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c index 5842f29d43e2..6b4d09e623eb 100644 --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c @@ -79,14 +79,11 @@ cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx) } } - if (ctx->pool) - rte_mempool_free(ctx->pool); + rte_mempool_free(ctx->pool); - if (ctx->ops) - rte_free(ctx->ops); + rte_free(ctx->ops); - if (ctx->ops_processed) - rte_free(ctx->ops_processed); + rte_free(ctx->ops_processed); rte_free(ctx); } diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index 51512af2ad81..51fad5a05505 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -57,8 +57,7 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx) rte_cryptodev_sym_session_free(ctx->sess); } } - if (ctx->pool) - rte_mempool_free(ctx->pool); + rte_mempool_free(ctx->pool); rte_free(ctx); } diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c index 1e9dfcfff087..87f3a90055aa 100644 --- a/app/test-crypto-perf/cperf_test_vector_parsing.c +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c @@ -551,10 +551,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts) err: if (fp) fclose(fp); - if (line) - free(line); - if (entry) - rte_free(entry); + free(line); + rte_free(entry); return -1; } diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 496eb0de00f0..c031330afcfe 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -42,8 +42,7 @@ cperf_verify_test_free(struct cperf_verify_ctx *ctx) rte_cryptodev_sym_session_free(ctx->sess); } - if (ctx->pool) - rte_mempool_free(ctx->pool); + rte_mempool_free(ctx->pool); rte_free(ctx); } -- 2.30.2