diff mbox

[PATCHv2] api: fix odp_version_api_str()

Message ID 1422979975-32548-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Feb. 3, 2015, 4:12 p.m. UTC
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 <maxim.uvarov@linaro.org>
---
 v2: remove version_types.h

 include/odp/api/version.h                          | 29 +++++++++++----------
 platform/linux-generic/Makefile.am                 |  3 +--
 .../linux-generic/include/odp/plat/version_types.h | 30 ----------------------
 platform/linux-generic/include/odp/version.h       | 25 ++++++++----------
 4 files changed, 28 insertions(+), 59 deletions(-)
 delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h

Comments

Mike Holmes Feb. 3, 2015, 4:28 p.m. UTC | #1
On 3 February 2015 at 11:12, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> 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 <maxim.uvarov@linaro.org>
>

Reviewed-by: Mike Holmes <mike.holmes@linaro.org>

Clears the new test case patch "validation: add version string check"
which should be added as insurance against this bug in the future before
closing the bug


> ---
>  v2: remove version_types.h
>
>  include/odp/api/version.h                          | 29
> +++++++++++----------
>  platform/linux-generic/Makefile.am                 |  3 +--
>  .../linux-generic/include/odp/plat/version_types.h | 30
> ----------------------
>  platform/linux-generic/include/odp/version.h       | 25 ++++++++----------
>  4 files changed, 28 insertions(+), 59 deletions(-)
>  delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h
>
> diff --git a/include/odp/api/version.h b/include/odp/api/version.h
> index 0889d9c..bfeb40b 100644
> --- a/include/odp/api/version.h
> +++ b/include/odp/api/version.h
> @@ -48,24 +48,27 @@ extern "C" {
>   */
>  #define ODP_VERSION_API_MINOR 0
>
> +/** @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)
> +
>  /**
>   * Returns ODP API version string
>   */
> -const char *odp_version_api_str(void);
> -
> +static inline const char *odp_version_api_str(void)
> +{
> +       return ODP_VERSION_API_STR;
> +}
>
>  /**
> - * 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 addb5ec..3624377 100644
> --- a/platform/linux-generic/Makefile.am
> +++ b/platform/linux-generic/Makefile.am
> @@ -56,8 +56,7 @@ odpplatinclude_HEADERS = \
>
> $(top_srcdir)/platform/linux-generic/include/odp/plat/pool_types.h \
>
> $(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/version_types.h
> +
>  $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h
>
>  odpapiincludedir= $(includedir)/odp/api
>  odpapiinclude_HEADERS = \
> 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..33cc5ba 100644
> --- a/platform/linux-generic/include/odp/version.h
> +++ b/platform/linux-generic/include/odp/version.h
> @@ -17,22 +17,19 @@
>  extern "C" {
>  #endif
>
> -#include <odp/plat/version_types.h>
> -
> -/** @ingroup odp_ver_abt_log_dbg
> - *  @{
> - */
> -
> -static inline const char *odp_version_api_str(void)
> -{
> -       return ODP_VERSION_API_STR;
> -}
> +#include <odp/api/version.h>
>
>  /**
> - * @}
> - */
> -
> -#include <odp/api/version.h>
> + * 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
>  }
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/include/odp/api/version.h b/include/odp/api/version.h
index 0889d9c..bfeb40b 100644
--- a/include/odp/api/version.h
+++ b/include/odp/api/version.h
@@ -48,24 +48,27 @@  extern "C" {
  */
 #define ODP_VERSION_API_MINOR 0
 
+/** @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)
+
 /**
  * Returns ODP API version string
  */
-const char *odp_version_api_str(void);
-
+static inline const char *odp_version_api_str(void)
+{
+	return ODP_VERSION_API_STR;
+}
 
 /**
- * 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 addb5ec..3624377 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -56,8 +56,7 @@  odpplatinclude_HEADERS = \
 		  $(top_srcdir)/platform/linux-generic/include/odp/plat/pool_types.h \
 		  $(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/version_types.h
+		  $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h
 
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
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..33cc5ba 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -17,22 +17,19 @@ 
 extern "C" {
 #endif
 
-#include <odp/plat/version_types.h>
-
-/** @ingroup odp_ver_abt_log_dbg
- *  @{
- */
-
-static inline const char *odp_version_api_str(void)
-{
-	return ODP_VERSION_API_STR;
-}
+#include <odp/api/version.h>
 
 /**
- * @}
- */
-
-#include <odp/api/version.h>
+ * 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
 }