aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2014-10-02 16:27:42 -0400
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-10-24 01:05:01 +0400
commit39951f7312f827a756eb517c142ab2b87d18a661 (patch)
tree4149f23358a41cd461e8bfb5c3c59b995817fc37 /example
parent2d37e28b88476434e94621e2c564709134f69728 (diff)
odp_example.c: fix dead code path
tot is = i which cannot leave the for loop without being positive unless it exits entirely and never reaches the test statement. Or QUEUE_ROUNDS is #defined to 0 rather than (512*1024) Thus tot is always true and the else cannot execute Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r--example/odp_example/odp_example.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
index 0e9aa3dc4..5f25f892d 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -420,13 +420,8 @@ static int test_schedule_one_many(const char *str, int thr,
odp_barrier_sync(barrier);
clear_sched_queues();
- if (tot) {
- cycles = cycles/tot;
- ns = ns/tot;
- } else {
- cycles = 0;
- ns = 0;
- }
+ cycles = cycles/tot;
+ ns = ns/tot;
printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
thr, str, cycles, ns);
@@ -499,13 +494,8 @@ static int test_schedule_single(const char *str, int thr,
odp_barrier_sync(barrier);
clear_sched_queues();
- if (tot) {
- cycles = cycles/tot;
- ns = ns/tot;
- } else {
- cycles = 0;
- ns = 0;
- }
+ cycles = cycles/tot;
+ ns = ns/tot;
printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
thr, str, cycles, ns);
@@ -582,13 +572,8 @@ static int test_schedule_many(const char *str, int thr,
odp_barrier_sync(barrier);
clear_sched_queues();
- if (tot) {
- cycles = cycles/tot;
- ns = ns/tot;
- } else {
- cycles = 0;
- ns = 0;
- }
+ cycles = cycles/tot;
+ ns = ns/tot;
printf(" [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
thr, str, cycles, ns);