From patchwork Thu Oct 30 22:17:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 39852 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 493B220C70 for ; Thu, 30 Oct 2014 22:18:22 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf3514573lbj.11 for ; Thu, 30 Oct 2014 15:18:21 -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=iReYAtrHKlzGKIcJvSGe0wKk8xt/h2mQxWdZRmToNh0=; b=EgINBMP1EWBc9t8LIikAlTuHh9wV0qxOI1Px5gV+pTLMlaQVxM31QHCawrIy14xUL0 Kc5GTtOKIn80zQqaNuslW9UHpH8V1IbdCDN0EUaAGbA1MbzJcml+54tBcCZrSynurgM5 fqM4cVBb4fXXZP7mXcX+q/f2WwaWMOcbm1tsPK/FpDR+V76lWIqAl2a6Lov1LUzelmeA o43FNnLvZrLBLJM29bAcr0F6uQ+7XNWjAioRmzF1ZhJBzom8hrf6388NwJSnSXbIUWMZ A0zFideyJYGNies+V1xHPnomMuKDZ4RL+xyx28KNP45+g5/ZSqNo2UkF+H3oayPMPREP q+Qw== X-Gm-Message-State: ALoCoQnVpVKbJ7BCj+19XNXuwM4WANfEXMUTgxb9+AuQg2GIaTjF+ESPwdStWjpcuw93ParzCkJz X-Received: by 10.152.3.168 with SMTP id d8mr3337366lad.0.1414707501004; Thu, 30 Oct 2014 15:18:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.106 with SMTP id ln10ls362905lac.103.gmail; Thu, 30 Oct 2014 15:18:20 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr21698841laz.27.1414707500845; Thu, 30 Oct 2014 15:18:20 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id ay11si12737362lab.132.2014.10.30.15.18.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 15:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id z12so5206118lbi.11 for ; Thu, 30 Oct 2014 15:18:20 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr21698827laz.27.1414707500686; Thu, 30 Oct 2014 15:18:20 -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.84.229 with SMTP id c5csp115892lbz; Thu, 30 Oct 2014 15:18:19 -0700 (PDT) X-Received: by 10.224.1.200 with SMTP id 8mr29909719qag.54.1414707499249; Thu, 30 Oct 2014 15:18:19 -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 67si14463615qgx.12.2014.10.30.15.18.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 30 Oct 2014 15:18:19 -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 1Xjy2q-0000bX-Tq; Thu, 30 Oct 2014 22:18:16 +0000 Received: from mail-qg0-f54.google.com ([209.85.192.54]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xjy2k-0000bP-Dx for lng-odp@lists.linaro.org; Thu, 30 Oct 2014 22:18:10 +0000 Received: by mail-qg0-f54.google.com with SMTP id q108so4865510qgd.27 for ; Thu, 30 Oct 2014 15:18:05 -0700 (PDT) X-Received: by 10.229.139.195 with SMTP id f3mr30928547qcu.3.1414707485216; Thu, 30 Oct 2014 15:18:05 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id z4sm1636005qal.6.2014.10.30.15.18.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Oct 2014 15:18:04 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 30 Oct 2014 18:17:55 -0400 Message-Id: <1414707475-26664-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH v2] 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.180 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 --- Previous patch missed a case. Fixed indent example/odp_example/odp_example.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index 5f25f89..1ed4a0b 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -355,13 +355,8 @@ static int test_schedule_one_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);