From patchwork Mon Dec 8 21:02:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 42023 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D0E9202E0 for ; Mon, 8 Dec 2014 21:03:12 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf3198714wgh.0 for ; Mon, 08 Dec 2014 13:03:11 -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:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=58lCrH6cFImToTtAXGDsdpG9+7flXsY+AdVWFdqTfX0=; b=aY4IHqq0JO7X5H+spAdxfpRICxzj6ua7+ZW+sgnY4Hwd3IXJk/3EOdbJElWhvEVh6H vMt55oLFu7EzihvY0vq0elFiHEUmUQPMQ+ojzat0kcP6Mio6Mfie67F8+HgI56eLgQHX Z7nJdUQIMWMA3zztL6qN68f6FVOsspX30bfdVpuB/eFJIg0ePGyyGAis9GrU3wdOhz6Y Q2G3ObU9nZrwuLpincjH1WogdRHxbDOmmednipnZnPnqcas/e91a+OJl1uxHU25wI+62 EWSG0RzDAmOzYW5PQIndLXhKEL4vy5TTUtGW5rGjkKwzU2cB9CRnp85a73JAn+5ol3hI LGig== X-Gm-Message-State: ALoCoQlZjw/Ri4/qb3sxLwrygd0Umi23cj6AjzsF2uzUd3fG2hyqRu3kvI2jq1BYuDZ5K6mLF6zh X-Received: by 10.152.10.233 with SMTP id l9mr6576945lab.0.1418072591621; Mon, 08 Dec 2014 13:03:11 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.98 with SMTP id d2ls669853lae.19.gmail; Mon, 08 Dec 2014 13:03:11 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr18532489lac.70.1418072591466; Mon, 08 Dec 2014 13:03:11 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id p2si29637804laf.103.2014.12.08.13.03.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Dec 2014 13:03:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so4734576lab.35 for ; Mon, 08 Dec 2014 13:03:11 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr18068084lbo.32.1418072591045; Mon, 08 Dec 2014 13:03:11 -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 ew9csp670030lbc; Mon, 8 Dec 2014 13:03:09 -0800 (PST) X-Received: by 10.140.93.164 with SMTP id d33mr56834983qge.37.1418072588819; Mon, 08 Dec 2014 13:03:08 -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 w3si44623080qad.83.2014.12.08.13.03.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 08 Dec 2014 13:03:08 -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 1Xy5SU-0003ks-5S; Mon, 08 Dec 2014 21:03:06 +0000 Received: from mail-qg0-f49.google.com ([209.85.192.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xy5SG-0003kG-T8 for lng-odp@lists.linaro.org; Mon, 08 Dec 2014 21:02:52 +0000 Received: by mail-qg0-f49.google.com with SMTP id a108so4046165qge.8 for ; Mon, 08 Dec 2014 13:02:47 -0800 (PST) X-Received: by 10.140.36.168 with SMTP id p37mr54053021qgp.101.1418072567718; Mon, 08 Dec 2014 13:02:47 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id p4sm22015733qar.48.2014.12.08.13.02.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Dec 2014 13:02:47 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 8 Dec 2014 16:02:30 -0500 Message-Id: <1418072550-16407-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418072550-16407-1-git-send-email-mike.holmes@linaro.org> References: <1418072550-16407-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] api: odp_debug.h: move macros internally 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.215.48 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 Move the macros that are not used in the API internally: ODP_LOG ODP_PRINT ODP_ASSERT ODP_DEPRICATED ODP_UNUSED Signed-off-by: Mike Holmes Reviewed-by: Ciprian Barbu --- platform/linux-generic/include/api/odp_debug.h | 36 ---------------- .../linux-generic/include/odp_debug_internal.h | 50 +++++++++++++++++++++- platform/linux-generic/odp_buffer.c | 1 + 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h index cb2c3e9..f5e6821 100644 --- a/platform/linux-generic/include/api/odp_debug.h +++ b/platform/linux-generic/include/api/odp_debug.h @@ -12,9 +12,6 @@ #ifndef ODP_DEBUG_H_ #define ODP_DEBUG_H_ -#include -#include -#include #ifdef __cplusplus extern "C" { @@ -27,15 +24,6 @@ extern "C" { #ifdef __GNUC__ -/** - * Indicate deprecated variables, functions or types - */ -#define ODP_DEPRECATED __attribute__((__deprecated__)) - -/** - * Intentionally unused variables ot functions - */ -#define ODP_UNUSED __attribute__((__unused__)) #if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6)) @@ -48,21 +36,10 @@ extern "C" { #endif -#else -#define ODP_DEPRECATED -#define ODP_UNUSED #endif -/** - * 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(); } \ - } while (0) /** * Compile time assertion-macro - fail compilation if cond is false. @@ -98,19 +75,6 @@ typedef enum odp_log_level { */ extern int odp_override_log(odp_log_level_e level, const char *fmt, ...); -/** - * ODP LOG macro. - */ -#define ODP_LOG(level, fmt, ...) \ - odp_override_log(level, "%s:%d:%s():" fmt, __FILE__, \ - __LINE__, __func__, ##__VA_ARGS__) - -/** - * Log print message when the application calls one of the ODP APIs - * specifically for dumping internal data. - */ -#define ODP_PRINT(fmt, ...) \ - odp_override_log(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__) /** diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h index 647ebde..f6180d1 100644 --- a/platform/linux-generic/include/odp_debug_internal.h +++ b/platform/linux-generic/include/odp_debug_internal.h @@ -16,11 +16,45 @@ #ifndef ODP_DEBUG_INTERNAL_H_ #define ODP_DEBUG_INTERNAL_H_ +#include +#include +#include +#include #ifdef __cplusplus extern "C" { #endif -#include +/** @addtogroup odp_ver_abt_log_dbg + * @{ + */ + +#ifdef __GNUC__ + +/** + * Indicate deprecated variables, functions or types + */ +#define ODP_DEPRECATED __attribute__((__deprecated__)) + +/** + * Intentionally unused variables ot functions + */ +#define ODP_UNUSED __attribute__((__unused__)) + +#else + +#define ODP_DEPRECATED +#define ODP_UNUSED + +#endif + +/** + * 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(); } \ + } while (0) /** * This macro is used to indicate when a given function is not implemented @@ -54,6 +88,20 @@ extern "C" { abort(); \ } while (0) +/** + * ODP LOG macro. + */ +#define ODP_LOG(level, fmt, ...) \ + odp_override_log(level, "%s:%d:%s():" fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__) + +/** + * Log print message when the application calls one of the ODP APIs + * specifically for dumping internal data. + */ +#define ODP_PRINT(fmt, ...) \ + odp_override_log(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__) + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c index bcbb99a..df68aa9 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/odp_buffer.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include