mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 21:44:23 -04:00
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: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220830093411.1511040-5-jani.nikula@intel.com
This commit is contained in:
@@ -241,8 +241,6 @@ void __i915_sw_fence_init(struct i915_sw_fence *fence,
|
||||
const char *name,
|
||||
struct lock_class_key *key)
|
||||
{
|
||||
BUG_ON(!fn);
|
||||
|
||||
__init_waitqueue_head(&fence->wait, name, key);
|
||||
fence->fn = fn;
|
||||
#ifdef CONFIG_DRM_I915_SW_FENCE_CHECK_DAG
|
||||
|
||||
@@ -48,11 +48,15 @@ void __i915_sw_fence_init(struct i915_sw_fence *fence,
|
||||
do { \
|
||||
static struct lock_class_key __key; \
|
||||
\
|
||||
BUILD_BUG_ON((fn) == NULL); \
|
||||
__i915_sw_fence_init((fence), (fn), #fence, &__key); \
|
||||
} while (0)
|
||||
#else
|
||||
#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
|
||||
|
||||
void i915_sw_fence_reinit(struct i915_sw_fence *fence);
|
||||
|
||||
Reference in New Issue
Block a user