intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: make GEM_WARN_ON less terrible
@ 2018-03-19 18:08 Matthew Auld
  2018-03-19 18:17 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Matthew Auld @ 2018-03-19 18:08 UTC (permalink / raw)
  To: intel-gfx

GEM_WARN_ON() was originally intended to be used only as:

   if (GEM_WARN_ON(expr))
	...

but it just so happens to also work as simply:

   GEM_WARN_ON(expr);

since it just wraps WARN_ON, which is a little misleading since for
!DRM_I915_DEBUG_GEM builds the second case will actually break the
build. Given that there are some patches floating around which seem to
miss this, it probably makes sense to just make it work for both cases.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 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 8922344fc21b..6a4375437b88 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -44,7 +44,7 @@
 
 #else
 #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
-#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
+#define GEM_WARN_ON(expr) ({BUILD_BUG_ON_INVALID(expr), 0;})
 
 #define GEM_DEBUG_DECL(var)
 #define GEM_DEBUG_EXEC(expr) do { } while (0)
-- 
2.14.3

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-04 10:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19 18:08 [PATCH] drm/i915: make GEM_WARN_ON less terrible Matthew Auld
2018-03-19 18:17 ` Chris Wilson
2018-03-19 19:23   ` Matthew Auld
2018-03-19 20:21     ` Jani Nikula
2018-04-04  9:13       ` Joonas Lahtinen
2018-04-04 10:05         ` Matthew Auld
2018-04-04 10:24           ` Joonas Lahtinen
2018-03-19 19:18 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-03-19 19:36 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-19 22:33 ` ✓ Fi.CI.IGT: " Patchwork

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).