Commit 03e067bc authored by Jani Nikula's avatar Jani Nikula

drm/i915/fence: replace BUG_ON() with BUILD_BUG_ON()

Avoid BUG_ON(). Since __i915_sw_fence_init() is always called via a
wrapper macro, we can replace it with a compile time BUILD_BUG_ON().
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-5-jani.nikula@intel.com
parent 6f10c4d6
...@@ -241,8 +241,6 @@ void __i915_sw_fence_init(struct i915_sw_fence *fence, ...@@ -241,8 +241,6 @@ void __i915_sw_fence_init(struct i915_sw_fence *fence,
const char *name, const char *name,
struct lock_class_key *key) struct lock_class_key *key)
{ {
BUG_ON(!fn);
__init_waitqueue_head(&fence->wait, name, key); __init_waitqueue_head(&fence->wait, name, key);
fence->fn = fn; fence->fn = fn;
#ifdef CONFIG_DRM_I915_SW_FENCE_CHECK_DAG #ifdef CONFIG_DRM_I915_SW_FENCE_CHECK_DAG
......
...@@ -48,11 +48,15 @@ void __i915_sw_fence_init(struct i915_sw_fence *fence, ...@@ -48,11 +48,15 @@ void __i915_sw_fence_init(struct i915_sw_fence *fence,
do { \ do { \
static struct lock_class_key __key; \ static struct lock_class_key __key; \
\ \
BUILD_BUG_ON((fn) == NULL); \
__i915_sw_fence_init((fence), (fn), #fence, &__key); \ __i915_sw_fence_init((fence), (fn), #fence, &__key); \
} while (0) } while (0)
#else #else
#define i915_sw_fence_init(fence, fn) \ #define i915_sw_fence_init(fence, fn) \
__i915_sw_fence_init((fence), (fn), NULL, NULL) do { \
BUILD_BUG_ON((fn) == NULL); \
__i915_sw_fence_init((fence), (fn), NULL, NULL); \
} while (0)
#endif #endif
void i915_sw_fence_reinit(struct i915_sw_fence *fence); void i915_sw_fence_reinit(struct i915_sw_fence *fence);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment