diff mbox series

[1/6] app/test: fix unused but set variables

Message ID 20211115175855.1091621-2-conor.walsh@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series fix unused but set variables | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Conor Walsh Nov. 15, 2021, 5:58 p.m. UTC
This patch fixes unused but set variables within the following test apps:
 - test distributor perf
 - test thash perf

Bugzilla ID: 881
Fixes: c0de0eb82e40 ("distributor: switch over to new API")
Fixes: 239fffe0402e ("test/thash: add performance tests for Toeplitz hash")
Cc: stable@dpdk.org

Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 app/test/test_distributor_perf.c | 3 ---
 app/test/test_thash_perf.c       | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c
index fdbeae6d2f..92e330f194 100644
--- a/app/test/test_distributor_perf.c
+++ b/app/test/test_distributor_perf.c
@@ -108,7 +108,6 @@  static int
 handle_work(void *arg)
 {
 	struct rte_distributor *d = arg;
-	unsigned int count = 0;
 	unsigned int num = 0;
 	int i;
 	unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
@@ -120,11 +119,9 @@  handle_work(void *arg)
 	num = rte_distributor_get_pkt(d, id, buf, buf, num);
 	while (!quit) {
 		worker_stats[id].handled_packets += num;
-		count += num;
 		num = rte_distributor_get_pkt(d, id, buf, buf, num);
 	}
 	worker_stats[id].handled_packets += num;
-	count += num;
 	rte_distributor_return_pkt(d, id, buf, num);
 	return 0;
 }
diff --git a/app/test/test_thash_perf.c b/app/test/test_thash_perf.c
index 7aa9360120..687582aa32 100644
--- a/app/test/test_thash_perf.c
+++ b/app/test/test_thash_perf.c
@@ -61,6 +61,9 @@  run_rss_calc(uint32_t *tuples[BATCH_SZ], enum test_rss_type type, int len,
 	}
 	end_tsc = rte_rdtsc_precise();
 
+	/* To avoid compiler warnings set hash to used. */
+	RTE_SET_USED(hash);
+
 	return end_tsc - start_tsc;
 }