Skip to content

Commit fcd9e8a

Browse files
andy-shevjlahtine-intel
authored andcommitted
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 6863f56 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Fixes: 214707f ("drm/i915/selftests: Wrap a timer into a i915_sw_fence") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240829155950.1141978-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com> (cherry picked from commit 5bf4720) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
1 parent e870563 commit fcd9e8a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/i915/i915_sw_fence.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)
5151
debug_object_init(fence, &i915_sw_fence_debug_descr);
5252
}
5353

54-
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
54+
static inline __maybe_unused void debug_fence_init_onstack(struct i915_sw_fence *fence)
5555
{
5656
debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr);
5757
}
@@ -94,7 +94,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)
9494
{
9595
}
9696

97-
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
97+
static inline __maybe_unused void debug_fence_init_onstack(struct i915_sw_fence *fence)
9898
{
9999
}
100100

0 commit comments

Comments
 (0)