[spp] [PATCH 2/3] spp_primary: remove declaration in for loop

ogawa.yasufumi at lab.ntt.co.jp ogawa.yasufumi at lab.ntt.co.jp
Thu Apr 4 11:57:39 CEST 2019


From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>

For some environment, declaration in for loop cause an error. This
update is to move it from.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/primary/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/primary/init.c b/src/primary/init.c
index 28ad0a7..60e5c47 100644
--- a/src/primary/init.c
+++ b/src/primary/init.c
@@ -111,6 +111,7 @@ init(int argc, char *argv[])
 	const struct rte_memzone *mz;
 	uint16_t count, total_ports;
 	char log_msg[1024] = { '\0' };  /* temporary log message */
+	int i;
 
 	/* init EAL, parsing EAL args */
 	retval = rte_eal_init(argc, argv);
@@ -169,7 +170,7 @@ init(int argc, char *argv[])
 		lcore_id_used[lcore_id] = 1;
 	}
 	sprintf(log_msg, "Used lcores: ");
-	for (int i = 0; i < RTE_MAX_LCORE; i++) {
+	for (i = 0; i < RTE_MAX_LCORE; i++) {
 		if (lcore_id_used[i] == 1)
 			sprintf(log_msg + strlen(log_msg), "%d ", i);
 	}
-- 
2.7.4



More information about the spp mailing list