DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] eal: check error conditinos for every loop iteration
Date: Wed, 16 Apr 2014 06:50:40 -0400	[thread overview]
Message-ID: <1397645440-14813-1-git-send-email-nhorman@tuxdriver.com> (raw)

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 <nhorman@tuxdriver.com>
Reported-by: Pablo De Lara Guarch  <pablo.de.lara.guarch@intel.com>
CC: Pablo De Lara Guarch  <pablo.de.lara.guarch@intel.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 lib/librte_eal/common/eal_common_cpuflags.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c
index f9c1840..5c0927c 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);
 		}
+	}
 }
-- 
1.8.3.1

             reply	other threads:[~2014-04-16 10:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 10:50 Neil Horman [this message]
2014-04-17 22:26 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397645440-14813-1-git-send-email-nhorman@tuxdriver.com \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).