From patchwork Thu Oct 2 20:27:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38304 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3AA8E20549 for ; Thu, 2 Oct 2014 20:28:06 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id b6sf1703323lbj.3 for ; Thu, 02 Oct 2014 13:28:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=RLsJbkhug1cwSi/aTjw7LJu9JUU3LhyL8kw82kwnrNA=; b=YVDMbn9vb/UManzR5CIMeuUGphLIOUUkE+PIgvsJuJrlHoVj00VcIKiGqhj7PhQS0g OScfRmYAClPdiOuNjtIEtNKpDc9p8aICZZQHxg0+AvX/8QKoan7DqaZeGU5/G7WBCt9N MFozs44wHBElLJfwsytD5E7R3gAaoC2FgMr83tXskXWnxQ79XZKB212/rAjhTTozVca8 B6gXKEzG2Y3kFe09vxHURm6fOue6PJwFSISnIKPcyKgFU0EW8hcWh9sdo4n1rhFCQkcB xKhA2HmUvDqGlJbwznrQ0N7sE5l9lEIbzPzwDtbaSDvE5Chu8BYVb7wR8WGo/L8bwzFd OFSw== X-Gm-Message-State: ALoCoQm9dedCKOx7Rhb6aoKDdGn28Aywy2ko12MTMl+dIxTMVyjJP/RGHyT5BX5jxGWyNshGxHGd X-Received: by 10.112.168.225 with SMTP id zz1mr206936lbb.8.1412281684582; Thu, 02 Oct 2014 13:28:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.72 with SMTP id lm8ls319277lac.9.gmail; Thu, 02 Oct 2014 13:28:04 -0700 (PDT) X-Received: by 10.112.25.65 with SMTP id a1mr970975lbg.85.1412281684310; Thu, 02 Oct 2014 13:28:04 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id ku1si8286996lbc.20.2014.10.02.13.28.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Oct 2014 13:28:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so2975894lbv.5 for ; Thu, 02 Oct 2014 13:28:04 -0700 (PDT) X-Received: by 10.112.130.226 with SMTP id oh2mr1100032lbb.100.1412281684118; Thu, 02 Oct 2014 13:28:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp124763lbb; Thu, 2 Oct 2014 13:28:03 -0700 (PDT) X-Received: by 10.224.38.68 with SMTP id a4mr1572031qae.85.1412281683020; Thu, 02 Oct 2014 13:28:03 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id k39si9180809qgk.48.2014.10.02.13.28.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 02 Oct 2014 13:28:03 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XZmyn-0007Wq-7k; Thu, 02 Oct 2014 20:28:01 +0000 Received: from mail-qa0-f43.google.com ([209.85.216.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XZmyg-0007Wl-RQ for lng-odp@lists.linaro.org; Thu, 02 Oct 2014 20:27:54 +0000 Received: by mail-qa0-f43.google.com with SMTP id s7so2298246qap.2 for ; Thu, 02 Oct 2014 13:27:49 -0700 (PDT) X-Received: by 10.224.32.138 with SMTP id c10mr1855604qad.1.1412281669606; Thu, 02 Oct 2014 13:27:49 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id w6sm4074567qas.26.2014.10.02.13.27.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Oct 2014 13:27:49 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 2 Oct 2014 16:27:42 -0400 Message-Id: <1412281662-37873-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] odp_example.c: fix dead code path X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- example/odp_example/odp_example.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index c80dbbc..dd572eb 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -415,13 +415,8 @@ static int test_schedule_one_many(const char *str, int thr, odp_barrier_sync(&test_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); @@ -493,13 +488,8 @@ static int test_schedule_single(const char *str, int thr, odp_barrier_sync(&test_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); @@ -575,13 +565,8 @@ static int test_schedule_many(const char *str, int thr, odp_barrier_sync(&test_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);