Skip to content

Commit ba35d3b

Browse files
andy-shevgregkh
authored andcommitted
drm/mm: Mark drm_mm_interval_tree*() functions with __maybe_unused
[ Upstream commit 53bd7c1 ] The INTERVAL_TREE_DEFINE() uncoditionally provides a bunch of helper functions which in some cases may be not used. This, in particular, prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: .../drm/drm_mm.c:152:1: error: unused function 'drm_mm_interval_tree_insert' [-Werror,-Wunused-function] 152 | INTERVAL_TREE_DEFINE(struct drm_mm_node, rb, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 153 | u64, __subtree_last, | ~~~~~~~~~~~~~~~~~~~~ 154 | START, LAST, static inline, drm_mm_interval_tree) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by marking drm_mm_interval_tree*() functions with __maybe_unused. See also commit 6863f56 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Fixes: 202b52b ("drm: Track drm_mm nodes with an interval tree") 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0c24b82 commit ba35d3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_mm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void show_leaks(struct drm_mm *mm) { }
154154

155155
INTERVAL_TREE_DEFINE(struct drm_mm_node, rb,
156156
u64, __subtree_last,
157-
START, LAST, static inline, drm_mm_interval_tree)
157+
START, LAST, static inline __maybe_unused, drm_mm_interval_tree)
158158

159159
struct drm_mm_node *
160160
__drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last)

0 commit comments

Comments
 (0)