From patchwork Wed Nov 19 16:12:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 41195 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F0D0B241C9 for ; Wed, 19 Nov 2014 16:13:27 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf933400eek.6 for ; Wed, 19 Nov 2014 08:13:26 -0800 (PST) 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=0vcsZ04Q7XjCgzY8w1H+wVWHT5eMKyR8n5WqmeqP1yc=; b=JveCZsw/n6mMCnTDrJCoUc+jSbGDJ+5rG0LZRBUca3bIAlpPX/0vNvFSAn+Ud9mXRV kAeNeiJnkgI7Gmw5w/bpOlD0lzmdJZ6tnVM7GAIzoi0CXuV14J84TJlz9htK4HcA9vGe o4Ba0gNc0CVgth0lZs10sCphRUYLhAtTZ+9M2i99EIgVXuyS8Gcu1aQY/GuJxtWACQz3 D6gvp2xIO19wu4qhg5iEeSe8Rpp2LVYckdjYt2C1lkgGL/4XvlBScM6FK0a9wN+E9Oh/ WOwd3S6KnsJyIXQnaycAGlIrfZj+u73T85zA50v53sIwvZHEQonJaQK9E0he/NKHa4t7 f3ag== X-Gm-Message-State: ALoCoQk5DP5PePI5luDoQvZZKAI36+TGWuxYbz7QRGcoXtJGDhuCDsmLg01Wmoux+MrC8B46WDmy X-Received: by 10.112.163.229 with SMTP id yl5mr55671lbb.23.1416413606867; Wed, 19 Nov 2014 08:13:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.46 with SMTP id u14ls1357470laz.96.gmail; Wed, 19 Nov 2014 08:13:26 -0800 (PST) X-Received: by 10.153.6.9 with SMTP id cq9mr3537466lad.79.1416413606648; Wed, 19 Nov 2014 08:13:26 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id wj6si2225019lbb.90.2014.11.19.08.13.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 08:13:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so742302lbv.40 for ; Wed, 19 Nov 2014 08:13:26 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr6216639lab.40.1416413606526; Wed, 19 Nov 2014 08:13:26 -0800 (PST) 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.184.201 with SMTP id ew9csp110868lbc; Wed, 19 Nov 2014 08:13:25 -0800 (PST) X-Received: by 10.224.128.131 with SMTP id k3mr51864762qas.98.1416413605085; Wed, 19 Nov 2014 08:13:25 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id y20si1610523qaf.75.2014.11.19.08.13.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Nov 2014 08:13:25 -0800 (PST) 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 1Xr7sh-0003y5-0l; Wed, 19 Nov 2014 16:13:23 +0000 Received: from mail-lb0-f173.google.com ([209.85.217.173]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xr7sa-0003y0-DW for lng-odp@lists.linaro.org; Wed, 19 Nov 2014 16:13:16 +0000 Received: by mail-lb0-f173.google.com with SMTP id n15so765012lbi.4 for ; Wed, 19 Nov 2014 08:13:10 -0800 (PST) X-Received: by 10.152.23.73 with SMTP id k9mr720355laf.14.1416413590254; Wed, 19 Nov 2014 08:13:10 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id ug3sm532263lac.33.2014.11.19.08.13.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 08:13:09 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 19 Nov 2014 19:12:44 +0300 Message-Id: <1416413564-14626-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCH] ODP_ASSERT has to trap app not depending on debug 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: maxim.uvarov@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.181 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 Fix macro logic. Application has to be terminated in any case. Signed-off-by: Maxim Uvarov --- platform/linux-generic/include/api/odp_debug.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h index c9b2edd..1cbcb61 100644 --- a/platform/linux-generic/include/api/odp_debug.h +++ b/platform/linux-generic/include/api/odp_debug.h @@ -57,10 +57,13 @@ extern "C" { /** * Runtime assertion-macro - aborts if 'cond' is false. */ -#define ODP_ASSERT(cond, msg) \ - do { if ((ODP_DEBUG == 1) && (!(cond))) { \ - ODP_ERR("%s\n", msg); \ - abort(); } \ +#define ODP_ASSERT(cond, msg) \ + do { \ + if (!(cond)) { \ + if (ODP_DEBUG == 1) \ + ODP_ERR("%s\n", msg); \ + abort(); \ + } \ } while (0) /**