]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused
authorJani Nikula <jani.nikula@intel.com>
Tue, 3 Sep 2024 17:34:37 +0000 (20:34 +0300)
committerJani Nikula <jani.nikula@intel.com>
Wed, 4 Sep 2024 09:15:46 +0000 (12:15 +0300)
Clang build with CONFIG_DRM_DEBUG_MM=n, CONFIG_WERROR=y, and W=1 leads to:

  CC [M]  drivers/gpu/drm/drm_mm.o
../drivers/gpu/drm/drm_mm.c:614:20: error: function 'drm_mm_node_scanned_block' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static inline bool drm_mm_node_scanned_block(const struct drm_mm_node *node)
                   ^

Fix this by annotating drm_mm_node_scanned_block() with __maybe_unused.

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240903173437.3212437-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/drm_mm.c

index 1ed68d3cd80bade6d7054fa79709417304015858..ca254611b38238eb0d8fa337fec76ed63548c079 100644 (file)
@@ -611,7 +611,7 @@ int drm_mm_insert_node_in_range(struct drm_mm * const mm,
 }
 EXPORT_SYMBOL(drm_mm_insert_node_in_range);
 
-static inline bool drm_mm_node_scanned_block(const struct drm_mm_node *node)
+static inline __maybe_unused bool drm_mm_node_scanned_block(const struct drm_mm_node *node)
 {
        return test_bit(DRM_MM_NODE_SCANNED_BIT, &node->flags);
 }