Patchwork [i-g-t,3/4] lib: move write_stderr out of the #ifdef

login
register
mail settings
Submitter Daniel Vetter
Date Nov. 26, 2017, 7:42 p.m.
Message ID <20171126194211.15849-3-daniel.vetter@ffwll.ch>
Download mbox | patch
Permalink /patch/10075523/
State New
Headers show

Comments

Daniel Vetter - Nov. 26, 2017, 7:42 p.m.
Helps with making it compile everywhere. This fixes:

commit db31e3c1ca0953b6e6832c25060acd01012a66dd
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Wed Nov 8 12:06:52 2017 +0000

    lib/core: Avoid unused result in backtrace printing

(Yes, I don't have libunwind on this machine here. Accidentally)

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_core.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
tvrtko.ursulin@linux.intel.com - Nov. 27, 2017, 8:33 a.m.
On 26/11/2017 19:42, Daniel Vetter wrote:
> Helps with making it compile everywhere. This fixes:
> 
> commit db31e3c1ca0953b6e6832c25060acd01012a66dd
> Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Date:   Wed Nov 8 12:06:52 2017 +0000
> 
>      lib/core: Avoid unused result in backtrace printing
> 
> (Yes, I don't have libunwind on this machine here. Accidentally)
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>   lib/igt_core.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index b38498e9d13b..5f1d1d34dbc6 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -1231,6 +1231,16 @@ static bool run_under_gdb(void)
>   		strncmp(basename(buf), "gdb", 3) == 0);
>   }
>   
> +static void __write_stderr(const char *str, size_t len)
> +{
> +	igt_ignore_warn(write(STDERR_FILENO, str, len));
> +}
> +
> +static void write_stderr(const char *str)
> +{
> +	__write_stderr(str, strlen(str));
> +}
> +
>   #ifdef HAVE_LIBUNWIND
>   #define UNW_LOCAL_ONLY
>   #include <libunwind.h>
> @@ -1407,16 +1417,6 @@ xprintf(const char *fmt, ...)
>   	va_end(ap);
>   }
>   
> -static void __write_stderr(const char *str, size_t len)
> -{
> -	igt_ignore_warn(write(STDERR_FILENO, str, len));
> -}
> -
> -static void write_stderr(const char *str)
> -{
> -	__write_stderr(str, strlen(str));
> -}
> -
>   static void print_backtrace_sig_safe(void)
>   {
>   	unw_cursor_t cursor;
> 

Arek spotted this and fixed on Friday already, so you can drop it from 
your series.

Regards,

Tvrtko

Patch

diff --git a/lib/igt_core.c b/lib/igt_core.c
index b38498e9d13b..5f1d1d34dbc6 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1231,6 +1231,16 @@  static bool run_under_gdb(void)
 		strncmp(basename(buf), "gdb", 3) == 0);
 }
 
+static void __write_stderr(const char *str, size_t len)
+{
+	igt_ignore_warn(write(STDERR_FILENO, str, len));
+}
+
+static void write_stderr(const char *str)
+{
+	__write_stderr(str, strlen(str));
+}
+
 #ifdef HAVE_LIBUNWIND
 #define UNW_LOCAL_ONLY
 #include <libunwind.h>
@@ -1407,16 +1417,6 @@  xprintf(const char *fmt, ...)
 	va_end(ap);
 }
 
-static void __write_stderr(const char *str, size_t len)
-{
-	igt_ignore_warn(write(STDERR_FILENO, str, len));
-}
-
-static void write_stderr(const char *str)
-{
-	__write_stderr(str, strlen(str));
-}
-
 static void print_backtrace_sig_safe(void)
 {
 	unw_cursor_t cursor;