* [dpdk-dev] [PATCH] crypto/scheduler: fix build
@ 2017-07-09 9:44 Jan Blunck
2017-07-09 10:38 ` Thomas Monjalon
2017-07-09 15:05 ` Thomas Monjalon
0 siblings, 2 replies; 5+ messages in thread
From: Jan Blunck @ 2017-07-09 9:44 UTC (permalink / raw)
To: dev
Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
drivers/crypto/scheduler/scheduler_multicore.c: In function 'scheduler_stop':
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++)
^
compilation terminated due to -Wfatal-errors.
mk/internal/rte.compile-pre.mk:138: recipe for target 'scheduler_multicore.o'
failed
make[4]: *** [scheduler_multicore.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
drivers/crypto/scheduler/scheduler_multicore.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index a568be4f1..bed9a8fd8 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);
--
2.13.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/scheduler: fix build
2017-07-09 9:44 [dpdk-dev] [PATCH] crypto/scheduler: fix build Jan Blunck
@ 2017-07-09 10:38 ` Thomas Monjalon
2017-07-09 10:43 ` Jan Blunck
2017-07-09 15:05 ` Thomas Monjalon
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2017-07-09 10:38 UTC (permalink / raw)
To: Jan Blunck; +Cc: dev
09/07/2017 11:44, Jan Blunck:
> Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
>
> drivers/crypto/scheduler/scheduler_multicore.c: In function 'scheduler_stop':
> 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++)
> ^
I wonder why I have not spotted it.
What is your compiler? which version?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/scheduler: fix build
2017-07-09 10:38 ` Thomas Monjalon
@ 2017-07-09 10:43 ` Jan Blunck
2017-07-09 13:26 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Jan Blunck @ 2017-07-09 10:43 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Sun, Jul 9, 2017 at 6:38 AM, Thomas Monjalon <thomas@monjalon.net> wrote:
> 09/07/2017 11:44, Jan Blunck:
>> Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
>>
>> drivers/crypto/scheduler/scheduler_multicore.c: In function 'scheduler_stop':
>> 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++)
>> ^
>
> I wonder why I have not spotted it.
> What is your compiler? which version?
This is with Debian Jessie:
gcc version 4.9.2 (Debian 4.9.2-10)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/scheduler: fix build
2017-07-09 10:43 ` Jan Blunck
@ 2017-07-09 13:26 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-07-09 13:26 UTC (permalink / raw)
To: Jan Blunck; +Cc: dev
09/07/2017 12:43, Jan Blunck:
> On Sun, Jul 9, 2017 at 6:38 AM, Thomas Monjalon <thomas@monjalon.net> wrote:
> > 09/07/2017 11:44, Jan Blunck:
> >> Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
> >>
> >> drivers/crypto/scheduler/scheduler_multicore.c: In function 'scheduler_stop':
> >> 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++)
> >> ^
> >
> > I wonder why I have not spotted it.
> > What is your compiler? which version?
>
> This is with Debian Jessie:
>
> gcc version 4.9.2 (Debian 4.9.2-10)
OK, so I could update the title to "fix build with old gcc" ?
And add in the log that it has been seen with gcc 4.9.2.
Do you agree?
PS: I am testing with gcc 7.1.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/scheduler: fix build
2017-07-09 9:44 [dpdk-dev] [PATCH] crypto/scheduler: fix build Jan Blunck
2017-07-09 10:38 ` Thomas Monjalon
@ 2017-07-09 15:05 ` Thomas Monjalon
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-07-09 15:05 UTC (permalink / raw)
To: Jan Blunck; +Cc: dev
09/07/2017 11:44, Jan Blunck:
> Fixes 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")
>
> drivers/crypto/scheduler/scheduler_multicore.c: In function 'scheduler_stop':
> 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++)
> ^
> compilation terminated due to -Wfatal-errors.
> mk/internal/rte.compile-pre.mk:138: recipe for target 'scheduler_multicore.o'
> failed
> make[4]: *** [scheduler_multicore.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
>
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
Applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-09 15:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-09 9:44 [dpdk-dev] [PATCH] crypto/scheduler: fix build Jan Blunck
2017-07-09 10:38 ` Thomas Monjalon
2017-07-09 10:43 ` Jan Blunck
2017-07-09 13:26 ` Thomas Monjalon
2017-07-09 15:05 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).