Commit 5bf47205 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jani Nikula

drm/i915/fence: Mark debug_fence_init_onstack() with __maybe_unused

When debug_fence_init_onstack() is unused (CONFIG_DRM_I915_SELFTEST=n),
it prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y:

.../i915_sw_fence.c:97:20: error: unused function 'debug_fence_init_onstack' [-Werror,-Wunused-function]
   97 | static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~

Fix this by marking debug_fence_init_onstack() with __maybe_unused.

See also commit 6863f564 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").

Fixes: 214707fc ("drm/i915/selftests: Wrap a timer into a i915_sw_fence")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240829155950.1141978-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 2bb3fc53
...@@ -51,7 +51,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence) ...@@ -51,7 +51,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)
debug_object_init(fence, &i915_sw_fence_debug_descr); debug_object_init(fence, &i915_sw_fence_debug_descr);
} }
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence) static inline __maybe_unused void debug_fence_init_onstack(struct i915_sw_fence *fence)
{ {
debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr); debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr);
} }
...@@ -94,7 +94,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence) ...@@ -94,7 +94,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)
{ {
} }
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence) static inline __maybe_unused void debug_fence_init_onstack(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