[RFC PATCH v2 22/33] app/test-bbdev: use RTE_MAX3 to remove variable shadowing
Bruce Richardson
bruce.richardson at intel.com
Fri Nov 7 16:50:18 CET 2025
Nested use of RTE_MAX leads to variable shadowing for the internal
variables, so use RTE_MAX3 rather than two nested calls.
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
app/test-bbdev/test_bbdev_perf.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 27b0a6f523..9fb0a25948 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -552,12 +552,11 @@ create_mempools(struct active_device *ad, int socket_id,
&test_vector.entries[DATA_HARQ_OUTPUT];
/* allocate ops mempool */
- ops_pool_size = optimal_mempool_size(RTE_MAX(
+ ops_pool_size = optimal_mempool_size(RTE_MAX3(
/* Ops used plus 1 reference op */
- RTE_MAX((unsigned int)(ad->nb_queues * num_ops + 1),
+ (unsigned int)(ad->nb_queues * num_ops + 1),
/* Minimal cache size plus 1 reference op */
- (unsigned int)(1.5 * rte_lcore_count() *
- OPS_CACHE_SIZE + 1)),
+ (unsigned int)(1.5 * rte_lcore_count() * OPS_CACHE_SIZE + 1),
OPS_POOL_SIZE_MIN));
if (org_op_type == RTE_BBDEV_OP_NONE)
--
2.48.1
More information about the dev
mailing list