Skip to content

Commit f999995

Browse files
andy-shevjlahtine-intel
authored andcommitted
drm/i915/fence: Mark debug_fence_free() with __maybe_unused
When debug_fence_free() is unused (CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS=n), it prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: .../i915_sw_fence.c:118:20: error: unused function 'debug_fence_free' [-Werror,-Wunused-function] 118 | static inline void debug_fence_free(struct i915_sw_fence *fence) | ^~~~~~~~~~~~~~~~ Fix this by marking debug_fence_free() with __maybe_unused. See also commit 6863f56 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Fixes: fc15840 ("drm/i915: Integrate i915_sw_fence with debugobjects") Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Jani Nikula <[email protected]> (cherry picked from commit 8be4dce) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent fcd9e8a commit f999995

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/i915_sw_fence.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static inline void debug_fence_destroy(struct i915_sw_fence *fence)
7777
debug_object_destroy(fence, &i915_sw_fence_debug_descr);
7878
}
7979

80-
static inline void debug_fence_free(struct i915_sw_fence *fence)
80+
static inline __maybe_unused void debug_fence_free(struct i915_sw_fence *fence)
8181
{
8282
debug_object_free(fence, &i915_sw_fence_debug_descr);
8383
smp_wmb(); /* flush the change in state before reallocation */
@@ -115,7 +115,7 @@ static inline void debug_fence_destroy(struct i915_sw_fence *fence)
115115
{
116116
}
117117

118-
static inline void debug_fence_free(struct i915_sw_fence *fence)
118+
static inline __maybe_unused void debug_fence_free(struct i915_sw_fence *fence)
119119
{
120120
}
121121

0 commit comments

Comments
 (0)