Skip to contentSkip to conversation

drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused

PATCH In review Jani Nikula 2 participants 3 messages Sep 3, 2024 – Sep 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused

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 <[email protected]>
---
 drivers/gpu/drm/drm_mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_mm.c +1 -1
index 1ed68d3cd80b..ca254611b382 100644
@@ -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);
 }
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Jani Nikula

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.

FWIW,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author Applied
#2 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Jani Nikula

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)

                   ^
Quoted 4 lines
Quoted 1 line

Fix this by annotating drm_mm_node_scanned_block() with __maybe_unused.

FWIW,

Pushed to drm-misc-next, thanks for the review.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel