All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef
Date: Fri, 24 Nov 2017 11:01:16 +0000	[thread overview]
Message-ID: <a739bff9-bd99-f9c6-1616-6513b5b4fa3b@linux.intel.com> (raw)
In-Reply-To: <20171124103207.19233-1-arkadiusz.hiler@intel.com>


On 24/11/2017 10:32, Arkadiusz Hiler wrote:
> write_stderr() and __write_stderr() are defined behind ifdef on
> HAVE_LIBUNWIND, but do no depend on the lib in any way.
> 
> fatal_sig_handler() uses those helpers unconditionally.
> 
> This patch just moves the code couple of lines up, so the helpers are
> always available and do not break build on systems without libunwind.
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>   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 4fe48c97..6ce83bec 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;
> 

Oopsie, I did not spot that #ifdef block.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-11-24 11:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 10:32 [PATCH i-g-t] lib/igt_core: Move write_stderr out of LIBUNWIND ifdef Arkadiusz Hiler
2017-11-24 10:51 ` Chris Wilson
2017-11-24 11:07   ` Arkadiusz Hiler
2017-11-24 11:01 ` Tvrtko Ursulin [this message]
2017-11-24 14:33 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-24 17:06 ` ✗ Fi.CI.IGT: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a739bff9-bd99-f9c6-1616-6513b5b4fa3b@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.