提交 4cfa20c8 编写于 作者: M Matthew Auld 提交者: Chris Wilson

drm/i915: allow GEM_BUG_ON expr checking with !DEBUG_GEM

Use BUILD_BUG_ON_INVALID(expr) in GEM_BUG_ON when building without
DEBUG_GEM. This means the compiler can now check the validity of expr
without generating any code, in turn preventing us from inadvertently
breaking the build when DEBUG_GEM is not enabled.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161202184750.3843-1-matthew.auld@intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
上级 0798cff4
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifdef CONFIG_DRM_I915_DEBUG_GEM #ifdef CONFIG_DRM_I915_DEBUG_GEM
#define GEM_BUG_ON(expr) BUG_ON(expr) #define GEM_BUG_ON(expr) BUG_ON(expr)
#else #else
#define GEM_BUG_ON(expr) do { } while (0) #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
#endif #endif
#define I915_NUM_ENGINES 5 #define I915_NUM_ENGINES 5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册