test-compress-perf: fix unused-but-set-variable error

Message ID 20211029171622.330330-1-james.r.harris@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test-compress-perf: fix unused-but-set-variable error |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional fail Functional Testing issues

Commit Message

Harris, James R Oct. 29, 2021, 5:16 p.m. UTC
  clang-13 rightfully complains that the total_deq_ops
variable in cperf_cyclecount_op_setup is set but not
used, since the final accumulated total_deq_ops
results isn't used anywhere. So just remove the
total_deq_ops variable.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
---
 app/test-compress-perf/comp_perf_test_cyclecount.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

David Marchand Oct. 29, 2021, 6:57 p.m. UTC | #1
On Fri, Oct 29, 2021 at 7:18 PM Jim Harris <james.r.harris@intel.com> wrote:
>
> clang-13 rightfully complains that the total_deq_ops
> variable in cperf_cyclecount_op_setup is set but not
> used, since the final accumulated total_deq_ops
> results isn't used anywhere. So just remove the
> total_deq_ops variable.

Unused from the start:
Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool")

>
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
>  app/test-compress-perf/comp_perf_test_cyclecount.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
> index 55559a7d5a..c875ddbdac 100644
> --- a/app/test-compress-perf/comp_perf_test_cyclecount.c
> +++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
> @@ -76,7 +76,6 @@ cperf_cyclecount_op_setup(struct rte_comp_op **ops,
>
>         for (iter = 0; iter < num_iter; iter++) {
>                 uint32_t remaining_ops = mem->total_bufs;
> -               uint32_t total_deq_ops = 0;
>                 uint32_t total_enq_ops = 0;
>                 uint16_t num_enq = 0;
>                 uint16_t num_deq = 0;
> @@ -136,7 +135,6 @@ cperf_cyclecount_op_setup(struct rte_comp_op **ops,
>                         /* instead of the real dequeue operation */
>                         num_deq = num_ops;
>
> -                       total_deq_ops += num_deq;
>                         rte_mempool_put_bulk(mem->op_pool,
>                                              (void **)ops, num_deq);
>                 }
> --
> 2.32.0
>

Reviewed-by: David Marchand <david.marchand@redhat.com>
  
Akhil Goyal Oct. 31, 2021, 9:34 p.m. UTC | #2
> On Fri, Oct 29, 2021 at 7:18 PM Jim Harris <james.r.harris@intel.com> wrote:
> >
> > clang-13 rightfully complains that the total_deq_ops
> > variable in cperf_cyclecount_op_setup is set but not
> > used, since the final accumulated total_deq_ops
> > results isn't used anywhere. So just remove the
> > total_deq_ops variable.
> 
> Unused from the start:
> Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool")
> 
> >
> > Signed-off-by: Jim Harris <james.r.harris@intel.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index 55559a7d5a..c875ddbdac 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -76,7 +76,6 @@  cperf_cyclecount_op_setup(struct rte_comp_op **ops,
 
 	for (iter = 0; iter < num_iter; iter++) {
 		uint32_t remaining_ops = mem->total_bufs;
-		uint32_t total_deq_ops = 0;
 		uint32_t total_enq_ops = 0;
 		uint16_t num_enq = 0;
 		uint16_t num_deq = 0;
@@ -136,7 +135,6 @@  cperf_cyclecount_op_setup(struct rte_comp_op **ops,
 			/* instead of the real dequeue operation */
 			num_deq = num_ops;
 
-			total_deq_ops += num_deq;
 			rte_mempool_put_bulk(mem->op_pool,
 					     (void **)ops, num_deq);
 		}