diff mbox

[PATCHv4,1/2] linux-generic: move api version to c file

Message ID 1424174935-8291-2-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Feb. 17, 2015, 12:08 p.m. UTC
odp_version_api_str() in odp api defined as non static function and
there should be implementation in c file. Include required headers
so that str macro unrolls to correct version string.
https://bugs.linaro.org/show_bug.cgi?id=1194

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/Makefile.am           |  1 +
 platform/linux-generic/include/odp/version.h | 14 --------------
 platform/linux-generic/odp_version.c         | 17 +++++++++++++++++
 3 files changed, 18 insertions(+), 14 deletions(-)
 create mode 100644 platform/linux-generic/odp_version.c

Comments

Taras Kondratiuk Feb. 17, 2015, 1:15 p.m. UTC | #1
On 02/17/2015 02:08 PM, Maxim Uvarov wrote:
> odp_version_api_str() in odp api defined as non static function and
> there should be implementation in c file. Include required headers
> so that str macro unrolls to correct version string.
> https://bugs.linaro.org/show_bug.cgi?id=1194
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>   platform/linux-generic/Makefile.am           |  1 +
>   platform/linux-generic/include/odp/version.h | 14 --------------
>   platform/linux-generic/odp_version.c         | 17 +++++++++++++++++
>   3 files changed, 18 insertions(+), 14 deletions(-)
>   create mode 100644 platform/linux-generic/odp_version.c
>
> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
> index c24d59d..16adccc 100644
> --- a/platform/linux-generic/Makefile.am
> +++ b/platform/linux-generic/Makefile.am
> @@ -161,4 +161,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/version.h b/platform/linux-generic/include/odp/version.h
> index f29320a..c98cb30 100644
> --- a/platform/linux-generic/include/odp/version.h
> +++ b/platform/linux-generic/include/odp/version.h
> @@ -18,20 +18,6 @@ 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>
>
>   #ifdef __cplusplus
> diff --git a/platform/linux-generic/odp_version.c b/platform/linux-generic/odp_version.c
> new file mode 100644
> index 0000000..0a57b5e
> --- /dev/null
> +++ b/platform/linux-generic/odp_version.c
> @@ -0,0 +1,17 @@
> +/* Copyright (c) 2015, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier:     BSD-3-Clause
> + */
> +
> +#ifndef _GNU_SOURCE
> +#define _GNU_SOURCE
> +#endif

_GNU_SOURCE is not need here.
At least I don't see any issues without it.

> +
> +#include <odp/api/version.h>
> +#include <odp/plat/version_types.h>

#include <odp/version.h>
will include them both.
Also you won't have to touch these lines in patch #2.

> +
> +const char *odp_version_api_str(void)
> +{
> +	return ODP_VERSION_API_STR;
> +}
>

If above comment are addressed, then
Reviewed-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
diff mbox

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index c24d59d..16adccc 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -161,4 +161,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/version.h b/platform/linux-generic/include/odp/version.h
index f29320a..c98cb30 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -18,20 +18,6 @@  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>
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/odp_version.c b/platform/linux-generic/odp_version.c
new file mode 100644
index 0000000..0a57b5e
--- /dev/null
+++ b/platform/linux-generic/odp_version.c
@@ -0,0 +1,17 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <odp/api/version.h>
+#include <odp/plat/version_types.h>
+
+const char *odp_version_api_str(void)
+{
+	return ODP_VERSION_API_STR;
+}