From patchwork Wed Feb 4 10:35:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44329 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A746021514 for ; Wed, 4 Feb 2015 10:35:54 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf1719862wiv.0 for ; Wed, 04 Feb 2015 02:35:53 -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:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=MLTBGYZfzf9t8+wRMeBqhgbJjaop1+HeYjFZ6uSTK0Y=; b=F4W6D6zPAp2wI7UsE2qVhseypiEO4M1yiGGXh2lb6Y9+SnE2ildUS8+uNqspWqSOMW 5GIbBb5Y2UIX+a79pJQRfcAHFYgi9Ipj5w68U6eHFsxJhMAp7ImMRNNPOUatBAEuiGcG DlAhiguwYJh1mbTJq026qcTkcdXgtaHKif4Z2nbPVasGgh491i2mSGEOwc1q9ny2qzLu zSIZoRXIISA37EjGZWkWBgoR6uauPqrkqlJPqnr6awBnbKi0WDPxqUnBD8KibmD7GY0z LaocP8QK38zWIFcCvF7Vye9iOqjg5PMUd7da8X/l/BG3KzGD4Et+ZSByGyx5U76IPVuR kg0g== X-Gm-Message-State: ALoCoQndv91UGCPEs2MicK/ONQuKpxByicnJpZgu9dmePktjOD6XX1X3JQ6jgsxs0mc82PEL2q09 X-Received: by 10.152.87.15 with SMTP id t15mr3745823laz.9.1423046153461; Wed, 04 Feb 2015 02:35:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.182.140 with SMTP id ee12ls19838lac.1.gmail; Wed, 04 Feb 2015 02:35:53 -0800 (PST) X-Received: by 10.112.234.164 with SMTP id uf4mr3251171lbc.83.1423046153220; Wed, 04 Feb 2015 02:35:53 -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 to9si1029586lbb.15.2015.02.04.02.35.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 02:35:53 -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 mail-lb0-f176.google.com with SMTP id z12so724814lbi.7 for ; Wed, 04 Feb 2015 02:35:53 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr29900520laa.80.1423046153043; Wed, 04 Feb 2015 02:35:53 -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 h5csp401038lbj; Wed, 4 Feb 2015 02:35:52 -0800 (PST) X-Received: by 10.140.81.74 with SMTP id e68mr55966184qgd.41.1423046151559; Wed, 04 Feb 2015 02:35:51 -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 r9si1615469qcg.13.2015.02.04.02.35.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Feb 2015 02:35:51 -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 1YIxJE-0000IS-0B; Wed, 04 Feb 2015 10:35:48 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIxJ8-0000Gt-BI for lng-odp@lists.linaro.org; Wed, 04 Feb 2015 10:35:42 +0000 Received: by mail-la0-f53.google.com with SMTP id gq15so723710lab.12 for ; Wed, 04 Feb 2015 02:35:36 -0800 (PST) X-Received: by 10.112.151.10 with SMTP id um10mr13545858lbb.87.1423046136356; Wed, 04 Feb 2015 02:35:36 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-106.2com.net. [46.188.125.106]) by mx.google.com with ESMTPSA id g7sm269262lbc.33.2015.02.04.02.35.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Feb 2015 02:35:35 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 4 Feb 2015 13:35:29 +0300 Message-Id: <1423046129-19463-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] [PATCHv3] api: fix odp_version_api_str() 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 odp_version_api_str() has to be in API header while odp_version_impl_str() should be in linux-generic. That change fixes: https://bugs.linaro.org/show_bug.cgi?id=1194 Signed-off-by: Maxim Uvarov --- v3: make implementation version not online, for that odp_impl.c goes away and replaced with odp_version.c, which has implementation for version strings (api and implementation). include/odp/api/version.h | 12 ------- platform/linux-generic/Makefile.am | 5 ++- .../linux-generic/include/odp/plat/version_types.h | 30 ----------------- platform/linux-generic/include/odp/version.h | 25 +++++++------- platform/linux-generic/odp_impl.c | 35 ------------------- platform/linux-generic/odp_version.c | 39 ++++++++++++++++++++++ 6 files changed, 53 insertions(+), 93 deletions(-) delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h delete mode 100644 platform/linux-generic/odp_impl.c create mode 100644 platform/linux-generic/odp_version.c diff --git a/include/odp/api/version.h b/include/odp/api/version.h index 0889d9c..834835e 100644 --- a/include/odp/api/version.h +++ b/include/odp/api/version.h @@ -53,18 +53,6 @@ extern "C" { */ const char *odp_version_api_str(void); - -/** - * Returns ODP implementation version string - * - * Every implementation of ODP may receive bug fixes independent of the version - * of the API changing, this function returns that indication string. - * @note This string is implementation specific. - * @sa odp_version_api_str() - * - * @return null terminated implementation specific version identifier string - */ -const char *odp_version_impl_str(void); /** * @} */ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 81245b1..68603c7 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -57,8 +57,7 @@ odpplatinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/plat/queue_types.h \ $(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/version_types.h + $(top_srcdir)/platform/linux-generic/include/odp/plat/strong_types.h odpapiincludedir= $(includedir)/odp/api odpapiinclude_HEADERS = \ @@ -137,7 +136,6 @@ __LIB__libodp_la_SOURCES = \ odp_crypto.c \ odp_event.c \ odp_init.c \ - odp_impl.c \ odp_linux.c \ odp_packet.c \ odp_packet_flags.c \ @@ -154,4 +152,5 @@ __LIB__libodp_la_SOURCES = \ odp_ticketlock.c \ odp_time.c \ odp_timer.c \ + odp_version.c \ odp_weak.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 f29320a..0c50826 100644 --- a/platform/linux-generic/include/odp/version.h +++ b/platform/linux-generic/include/odp/version.h @@ -17,22 +17,21 @@ extern "C" { #endif -#include +#include -/** @ingroup odp_ver_abt_log_dbg - * @{ - */ - -static inline const char *odp_version_api_str(void) -{ - return ODP_VERSION_API_STR; -} +#define ODP_VERSION_IMPL 0 /** - * @} - */ - -#include + * Returns ODP implementation version string + * + * Every implementation of ODP may receive bug fixes independent of the version + * of the API changing, this function returns that indication string. + * @note This string is implementation specific. + * @sa odp_version_api_str() + * + * @return null terminated implementation specific version identifier string + */ +const char *odp_version_impl_str(void); #ifdef __cplusplus } 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 new file mode 100644 index 0000000..032564d --- /dev/null +++ b/platform/linux-generic/odp_version.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP API and Implementation information + */ + +#include +#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) + +const char *odp_version_api_str(void) +{ + return ODP_VERSION_API_STR; +} + +/** @internal Implementation version to string */ +#define ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL) + +const char *odp_version_impl_str(void) +{ + return ODP_VERSION_IMPL_STR; +}