From: Jan Blunck Date: Sun, 9 Jul 2017 09:44:16 +0000 (-0400) Subject: crypto/scheduler: fix build with old gcc X-Git-Tag: spdx-start~2547 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a76f6b1b0929f38aa91af75e9860637b60cee882;p=dpdk.git crypto/scheduler: fix build with old gcc Seen with gcc 4.9.2: drivers/crypto/scheduler/scheduler_multicore.c:286:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (uint16_t i = 0; i < sched_ctx->nb_wc; i++) ^ Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Signed-off-by: Jan Blunck --- diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index a568be4f11..bed9a8fd8a 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -280,10 +280,11 @@ scheduler_stop(struct rte_cryptodev *dev) { struct scheduler_ctx *sched_ctx = dev->data->dev_private; struct mc_scheduler_ctx *mc_ctx = sched_ctx->private_ctx; + uint16_t i; mc_ctx->stop_signal = 1; - for (uint16_t i = 0; i < sched_ctx->nb_wc; i++) + for (i = 0; i < sched_ctx->nb_wc; i++) rte_eal_wait_lcore(sched_ctx->wc_pool[i]); return 0; @@ -316,6 +317,7 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev) { struct scheduler_ctx *sched_ctx = dev->data->dev_private; struct mc_scheduler_ctx *mc_ctx; + uint16_t i; if (sched_ctx->private_ctx) rte_free(sched_ctx->private_ctx); @@ -328,7 +330,7 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev) } mc_ctx->num_workers = sched_ctx->nb_wc; - for (uint16_t i = 0; i < sched_ctx->nb_wc; i++) { + for (i = 0; i < sched_ctx->nb_wc; i++) { char r_name[16]; snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX "%u", i);