intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>, Arnd Bergmann <arnd@arndb.de>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression
Date: Fri, 11 Nov 2016 12:09:21 +0000	[thread overview]
Message-ID: <435ff05e-9bdb-bc6e-3ba4-d13c590a514d@linux.intel.com> (raw)
In-Reply-To: <20161111110538.GT9300@nuc-i3427.alporthouse.com>


On 11/11/2016 11:05, Chris Wilson wrote:
> On Fri, Nov 11, 2016 at 12:40:45PM +0200, Joonas Lahtinen wrote:
>> Evaluate GEM_BUG_ON expression similar to actual BUG_ON even if
>> DEBUG_GEM is disabled.
>>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_gem.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
>> index 51ec793..d141676 100644
>> --- a/drivers/gpu/drm/i915/i915_gem.h
>> +++ b/drivers/gpu/drm/i915/i915_gem.h
>> @@ -28,7 +28,7 @@
>>  #ifdef CONFIG_DRM_I915_DEBUG_GEM
>>  #define GEM_BUG_ON(expr) BUG_ON(expr)
>>  #else
>> -#define GEM_BUG_ON(expr) do { } while (0)
>> +#define GEM_BUG_ON(expr) do { if (expr) {} } while(0)
>>  #endif
>
> Mentioned on irc, that I'm not that keen on having the side-effects
> around. Suggestion was while (0) do { if (expr) {} } while (0)

Sounds good to me.

Regards,

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

  reply	other threads:[~2016-11-11 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 10:40 [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression Joonas Lahtinen
2016-11-11 11:05 ` Chris Wilson
2016-11-11 12:09   ` Tvrtko Ursulin [this message]
2016-11-11 11:16 ` ✓ Fi.CI.BAT: success for " 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=435ff05e-9bdb-bc6e-3ba4-d13c590a514d@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).