[API-NEXT,15/15] linux-gen: support older libconfig version

Message ID 20170127142921.29029-16-maxim.uvarov@linaro.org
State New
Headers show
Series
  • Merge tag 'v1.13.0.0' into api-next
Related show

Commit Message

Maxim Uvarov Jan. 27, 2017, 2:29 p.m.
Travis CI uses old libconfig8 amd64 1.3.2-2ubuntu2,
which does not have defines for errors. Move error print
under ifdef to fix compilation.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
 platform/linux-generic/odp_init.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.11.0.295.gd7dffce

Comments

Christophe Milard Feb. 1, 2017, 5:46 p.m. | #1
needs rebase, I think:
erachmi@erachmi-ericsson:~/linaro/ODP/odp$ git am
~/incoming/lng-odp_API-NEXT_PATCH_*
Applying: merge fix: platform/linux-generic/Makefile.am
error: patch failed: platform/linux-generic/Makefile.am:20
error: platform/linux-generic/Makefile.am: patch does not apply
Patch failed at 0001 merge fix: platform/linux-generic/Makefile.am
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Tried both with patch 15 alone and the hole series...

sorry...

Christophe.

On 27 January 2017 at 15:29, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> Travis CI uses old libconfig8 amd64 1.3.2-2ubuntu2,

> which does not have defines for errors. Move error print

> under ifdef to fix compilation.

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

> ---

>  platform/linux-generic/odp_init.c | 7 ++++++-

>  1 file changed, 6 insertions(+), 1 deletion(-)

>

> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c

> index 2cd8fe3f..685e02fa 100644

> --- a/platform/linux-generic/odp_init.c

> +++ b/platform/linux-generic/odp_init.c

> @@ -130,12 +130,17 @@ static int read_configfile(void)

>         if (config_filename) {

>                 ODP_DBG("Reading configuration file: %s\n", config_filename);

>                 if (!config_read_file(cf, config_filename)) {

> +#if defined(LIBCONFIG_VER_MAJOR) && LIBCONFIG_VER_MAJOR >= 1 && \

> +                                   LIBCONFIG_VER_MINOR >= 4

>                         ODP_ERR("%s:%d - %s\n",

>                                 config_error_file(cf),

>                                 config_error_line(cf),

>                                 config_error_text(cf));

> +#else

> +                       ODP_ERR("config_read_file\n");

> +#endif

>                         config_destroy(cf);

> -                       return(-1);

> +                       return -1;

>                 }

>         }

>

> --

> 2.11.0.295.gd7dffce

>
Christophe Milard Feb. 9, 2017, 6:40 p.m. | #2
Could apply it on current API next, today. I am fine with this patch (15/15)


On 1 February 2017 at 18:46, Christophe Milard
<christophe.milard@linaro.org> wrote:
> needs rebase, I think:

> erachmi@erachmi-ericsson:~/linaro/ODP/odp$ git am

> ~/incoming/lng-odp_API-NEXT_PATCH_*

> Applying: merge fix: platform/linux-generic/Makefile.am

> error: patch failed: platform/linux-generic/Makefile.am:20

> error: platform/linux-generic/Makefile.am: patch does not apply

> Patch failed at 0001 merge fix: platform/linux-generic/Makefile.am

> The copy of the patch that failed is found in: .git/rebase-apply/patch

> When you have resolved this problem, run "git am --continue".

> If you prefer to skip this patch, run "git am --skip" instead.

> To restore the original branch and stop patching, run "git am --abort".

>

> Tried both with patch 15 alone and the hole series...

>

> sorry...

>

> Christophe.

>

> On 27 January 2017 at 15:29, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

>> Travis CI uses old libconfig8 amd64 1.3.2-2ubuntu2,

>> which does not have defines for errors. Move error print

>> under ifdef to fix compilation.

>>

>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

>> ---

>>  platform/linux-generic/odp_init.c | 7 ++++++-

>>  1 file changed, 6 insertions(+), 1 deletion(-)

>>

>> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c

>> index 2cd8fe3f..685e02fa 100644

>> --- a/platform/linux-generic/odp_init.c

>> +++ b/platform/linux-generic/odp_init.c

>> @@ -130,12 +130,17 @@ static int read_configfile(void)

>>         if (config_filename) {

>>                 ODP_DBG("Reading configuration file: %s\n", config_filename);

>>                 if (!config_read_file(cf, config_filename)) {

>> +#if defined(LIBCONFIG_VER_MAJOR) && LIBCONFIG_VER_MAJOR >= 1 && \

>> +                                   LIBCONFIG_VER_MINOR >= 4

>>                         ODP_ERR("%s:%d - %s\n",

>>                                 config_error_file(cf),

>>                                 config_error_line(cf),

>>                                 config_error_text(cf));

>> +#else

>> +                       ODP_ERR("config_read_file\n");

>> +#endif

>>                         config_destroy(cf);

>> -                       return(-1);

>> +                       return -1;

>>                 }

>>         }

>>

>> --

>> 2.11.0.295.gd7dffce

>>
Christophe Milard Feb. 9, 2017, 6:41 p.m. | #3
On 27 January 2017 at 15:29, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> Travis CI uses old libconfig8 amd64 1.3.2-2ubuntu2,

> which does not have defines for errors. Move error print

> under ifdef to fix compilation.

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>


Reviewed-by: Christophe Milard <christophe.milard@linaro.org>


> ---

>  platform/linux-generic/odp_init.c | 7 ++++++-

>  1 file changed, 6 insertions(+), 1 deletion(-)

>

> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c

> index 2cd8fe3f..685e02fa 100644

> --- a/platform/linux-generic/odp_init.c

> +++ b/platform/linux-generic/odp_init.c

> @@ -130,12 +130,17 @@ static int read_configfile(void)

>         if (config_filename) {

>                 ODP_DBG("Reading configuration file: %s\n", config_filename);

>                 if (!config_read_file(cf, config_filename)) {

> +#if defined(LIBCONFIG_VER_MAJOR) && LIBCONFIG_VER_MAJOR >= 1 && \

> +                                   LIBCONFIG_VER_MINOR >= 4

>                         ODP_ERR("%s:%d - %s\n",

>                                 config_error_file(cf),

>                                 config_error_line(cf),

>                                 config_error_text(cf));

> +#else

> +                       ODP_ERR("config_read_file\n");

> +#endif

>                         config_destroy(cf);

> -                       return(-1);

> +                       return -1;

>                 }

>         }

>

> --

> 2.11.0.295.gd7dffce

>
Maxim Uvarov Feb. 9, 2017, 7:04 p.m. | #4
Merged this patch
Thanks!

On 02/09/17 21:41, Christophe Milard wrote:
> On 27 January 2017 at 15:29, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

>> Travis CI uses old libconfig8 amd64 1.3.2-2ubuntu2,

>> which does not have defines for errors. Move error print

>> under ifdef to fix compilation.

>>

>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

> 

> Reviewed-by: Christophe Milard <christophe.milard@linaro.org>

> 

>> ---

>>  platform/linux-generic/odp_init.c | 7 ++++++-

>>  1 file changed, 6 insertions(+), 1 deletion(-)

>>

>> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c

>> index 2cd8fe3f..685e02fa 100644

>> --- a/platform/linux-generic/odp_init.c

>> +++ b/platform/linux-generic/odp_init.c

>> @@ -130,12 +130,17 @@ static int read_configfile(void)

>>         if (config_filename) {

>>                 ODP_DBG("Reading configuration file: %s\n", config_filename);

>>                 if (!config_read_file(cf, config_filename)) {

>> +#if defined(LIBCONFIG_VER_MAJOR) && LIBCONFIG_VER_MAJOR >= 1 && \

>> +                                   LIBCONFIG_VER_MINOR >= 4

>>                         ODP_ERR("%s:%d - %s\n",

>>                                 config_error_file(cf),

>>                                 config_error_line(cf),

>>                                 config_error_text(cf));

>> +#else

>> +                       ODP_ERR("config_read_file\n");

>> +#endif

>>                         config_destroy(cf);

>> -                       return(-1);

>> +                       return -1;

>>                 }

>>         }

>>

>> --

>> 2.11.0.295.gd7dffce

>>

Patch

diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index 2cd8fe3f..685e02fa 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -130,12 +130,17 @@  static int read_configfile(void)
 	if (config_filename) {
 		ODP_DBG("Reading configuration file: %s\n", config_filename);
 		if (!config_read_file(cf, config_filename)) {
+#if defined(LIBCONFIG_VER_MAJOR) && LIBCONFIG_VER_MAJOR >= 1 && \
+				    LIBCONFIG_VER_MINOR >= 4
 			ODP_ERR("%s:%d - %s\n",
 				config_error_file(cf),
 				config_error_line(cf),
 				config_error_text(cf));
+#else
+			ODP_ERR("config_read_file\n");
+#endif
 			config_destroy(cf);
-			return(-1);
+			return -1;
 		}
 	}