diff mbox series

drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused

Message ID 20240903173437.3212437-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused | expand

Commit Message

Jani Nikula Sept. 3, 2024, 5:34 p.m. UTC
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>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Sept. 3, 2024, 6:24 p.m. UTC | #1
On Tue, Sep 03, 2024 at 08:34:37PM +0300, Jani Nikula wrote:
> 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,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Jani Nikula Sept. 4, 2024, 9:18 a.m. UTC | #2
On Tue, 03 Sep 2024, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> On Tue, Sep 03, 2024 at 08:34:37PM +0300, Jani Nikula wrote:
>> 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,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

BR,
Jani.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 1ed68d3cd80b..ca254611b382 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -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);
 }