From: Neil Horman Date: Wed, 16 Apr 2014 10:50:40 +0000 (-0400) Subject: eal: fix check of all requested CPU features X-Git-Tag: spdx-start~10882 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5d529448030493b954165a4f38eeb8d8cf703a84;p=dpdk.git eal: fix check of all requested CPU features Only the last feature was checked since commit 99f2cdf9ca10 (eal: fix %rbx corruption and simplify the code) The return code for rte_cpu_get_flag_enabled is only checked on the termination of the for loop that it is called inside, but should be checked for every iteration it makes through the for loop. This is caused by some silly missing brackets. Simply add them in Signed-off-by: Neil Horman Reported-by: Pablo De Lara Guarch Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c index f9c18402d9..5c0927c9b3 100644 --- a/lib/librte_eal/common/eal_common_cpuflags.c +++ b/lib/librte_eal/common/eal_common_cpuflags.c @@ -255,7 +255,7 @@ rte_cpu_check_supported(void) unsigned i; int ret; - for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) + for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) { ret = rte_cpu_get_flag_enabled(compile_time_flags[i]); if (ret < 0) { @@ -271,4 +271,5 @@ rte_cpu_check_supported(void) cpu_feature_table[compile_time_flags[i]].name); exit(1); } + } }