drm/i915: introduce GEM_WARN_ON
authorMatthew Auld <[email protected]>
Tue, 13 Dec 2016 20:32:19 +0000 (20:32 +0000)
committerChris Wilson <[email protected]>
Fri, 16 Dec 2016 21:16:36 +0000 (21:16 +0000)
In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, with the
simple goal of expressing warnings which are truly insane, and so are
only really useful for CI where we have some abusive tests.

v2:
  - use BUILD_BUG_ON_INVALID for !DEBUG_GEM
  - clarify commit message

Cc: Joonas Lahtinen <[email protected]>
Cc: Chris Wilson <[email protected]>
Suggested-by: Chris Wilson <[email protected]>
Signed-off-by: Matthew Auld <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
drivers/gpu/drm/i915/i915_gem.h

index 8801a14a78a20243990c3789cee3fe5b406f7c48..a585d47c420af15fea90fc6f5d862d24e4d07087 100644 (file)
 
 #ifdef CONFIG_DRM_I915_DEBUG_GEM
 #define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_WARN_ON(expr) WARN_ON(expr)
 #else
 #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
+#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
 #endif
 
 #define I915_NUM_ENGINES 5