From patchwork Tue Feb 17 12:06:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44743 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 93C0421544 for ; Tue, 17 Feb 2015 12:07:03 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf19348459wib.2 for ; Tue, 17 Feb 2015 04:07:02 -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=AsNXzPn6MY18ZAAGL4+yC6sDqTWdH8XRfHuQsJb5ElY=; b=Yut3FR3FoDvkGKga9jrCC+ozP/jcsi5IxtYorjfEYjYFcR7PijkakFSI4hSeSl/SVN aMB6enomEv6JdYWWpw2P222/47aVrdnJCz+gbDiB7OKN233NDHqfGWTRxo7qTK0mPqbc qdQqaGj6SSvgGsXbfaMTugXlTxNdAsTJpB2TrwDOzGMcYzhE+hJ11OWLw5XVLdUUi5el v+DsW5PSYE8TTzo9Txd/37ZOL56k6J1VORbR6LrLuRMN8kqskdDXM8uy/IdhzvZAX2DV 7E+3Cjn0EnDcSQ2VGkyrrOBEcUwRjJszhv7sHns8Bs9oPUOGupLSXK6OI8wcYNkISA7U YNDg== X-Gm-Message-State: ALoCoQnFSo2jRxYQ6edt5yrVz9sNyVjirst9OwMJSmsFi8YvlYz0gSVIgT6M16G57q6hB3uW0vx4 X-Received: by 10.152.26.74 with SMTP id j10mr3544446lag.10.1424174822786; Tue, 17 Feb 2015 04:07:02 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.194 with SMTP id a2ls669838lak.108.gmail; Tue, 17 Feb 2015 04:07:02 -0800 (PST) X-Received: by 10.152.5.41 with SMTP id p9mr28807636lap.7.1424174822630; Tue, 17 Feb 2015 04:07:02 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id yj1si10129483lab.138.2015.02.17.04.07.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 04:07:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbiz11 with SMTP id z11so4021099lbi.5 for ; Tue, 17 Feb 2015 04:07:02 -0800 (PST) X-Received: by 10.152.43.193 with SMTP id y1mr28684956lal.35.1424174822473; Tue, 17 Feb 2015 04:07:02 -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.35.133 with SMTP id h5csp2162300lbj; Tue, 17 Feb 2015 04:07:01 -0800 (PST) X-Received: by 10.140.144.205 with SMTP id 196mr365903qhq.53.1424174821171; Tue, 17 Feb 2015 04:07:01 -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 v20si17568948qge.78.2015.02.17.04.07.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Feb 2015 04:07:01 -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 1YNgvZ-0001Id-Ss; Tue, 17 Feb 2015 12:06:57 +0000 Received: from mail-la0-f48.google.com ([209.85.215.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNgvN-0001Hm-KI for lng-odp@lists.linaro.org; Tue, 17 Feb 2015 12:06:45 +0000 Received: by labpn19 with SMTP id pn19so35286494lab.4 for ; Tue, 17 Feb 2015 04:06:40 -0800 (PST) X-Received: by 10.152.42.169 with SMTP id p9mr338622lal.91.1424174800121; Tue, 17 Feb 2015 04:06:40 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id le6sm3517325lac.40.2015.02.17.04.06.38 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Feb 2015 04:06:39 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 17 Feb 2015 15:06:08 +0300 Message-Id: <1424174768-8163-3-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1424174768-8163-1-git-send-email-maxim.uvarov@linaro.org> References: <1424174768-8163-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 2/2] linux-generic: move versions to odp_version.c and get rid of odp_impl.c 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.176 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 implementation version to odp_version.c and get rid of odp_impl.c. Also include required api functions so that str macro unrolls correctly to version string. Signed-off-by: Maxim Uvarov --- platform/linux-generic/Makefile.am | 4 +-- .../linux-generic/include/odp/plat/version_types.h | 30 ------------------- platform/linux-generic/include/odp/version.h | 16 +++++++++- platform/linux-generic/odp_impl.c | 35 ---------------------- platform/linux-generic/odp_version.c | 7 ++++- 5 files changed, 22 insertions(+), 70 deletions(-) delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h delete mode 100644 platform/linux-generic/odp_impl.c diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 16adccc..b77b05b 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -61,8 +61,7 @@ odpplatinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/plat/schedule_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/strong_types.h \ - $(top_srcdir)/platform/linux-generic/include/odp/plat/timer_types.h \ - $(top_srcdir)/platform/linux-generic/include/odp/plat/version_types.h + $(top_srcdir)/platform/linux-generic/include/odp/plat/timer_types.h odpapiincludedir= $(includedir)/odp/api odpapiinclude_HEADERS = \ @@ -144,7 +143,6 @@ __LIB__libodp_la_SOURCES = \ odp_errno.c \ odp_event.c \ odp_init.c \ - odp_impl.c \ odp_linux.c \ odp_packet.c \ odp_packet_flags.c \ diff --git a/platform/linux-generic/include/odp/plat/version_types.h b/platform/linux-generic/include/odp/plat/version_types.h deleted file mode 100644 index e3327eb..0000000 --- a/platform/linux-generic/include/odp/plat/version_types.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_VERSION_TYPESH_ -#define ODP_VERSION_TYPESH_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @internal Version string expand */ -#define ODP_VERSION_STR_EXPAND(x) #x - -/** @internal Version to string */ -#define ODP_VERSION_TO_STR(x) ODP_VERSION_STR_EXPAND(x) - -/** @internal API version string */ -#define ODP_VERSION_API_STR \ -ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \ -ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \ -ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/version.h b/platform/linux-generic/include/odp/version.h index c98cb30..8a95221 100644 --- a/platform/linux-generic/include/odp/version.h +++ b/platform/linux-generic/include/odp/version.h @@ -17,9 +17,23 @@ extern "C" { #endif -#include +/** @internal Version string expand */ +#define ODP_VERSION_STR_EXPAND(x) #x + +/** @internal Version to string */ +#define ODP_VERSION_TO_STR(x) ODP_VERSION_STR_EXPAND(x) + +/** @internal API version string */ +#define ODP_VERSION_API_STR \ +ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \ +ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \ +ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) + #include +#define ODP_VERSION_IMPL 0 +#define ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL) + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_impl.c b/platform/linux-generic/odp_impl.c deleted file mode 100644 index ca3224d..0000000 --- a/platform/linux-generic/odp_impl.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - - -/** - * @file - * - * ODP Implementation information - */ - -#ifndef ODP_IMPL_H_ -#define ODP_IMPL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define ODP_VERSION_IMPL 0 -#define ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL) - -const char *odp_version_impl_str(void) -{ - return ODP_VERSION_IMPL_STR; -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/odp_version.c b/platform/linux-generic/odp_version.c index 0a57b5e..776f4da 100644 --- a/platform/linux-generic/odp_version.c +++ b/platform/linux-generic/odp_version.c @@ -9,9 +9,14 @@ #endif #include -#include +#include const char *odp_version_api_str(void) { return ODP_VERSION_API_STR; } + +const char *odp_version_impl_str(void) +{ + return ODP_VERSION_IMPL_STR; +}