Skip to content

Commit 6e8e042

Browse files
hygoniakpm00
authored andcommitted
mm/zsmalloc: add __maybe_unused attribute for is_first_zpdesc()
Commit c1b3bb7 ("mm/zsmalloc: use zpdesc in trylock_zspage()/lock_zspage()") introduces is_first_zpdesc() function. However, the function is only used when CONFIG_DEBUG_VM=y. When building with LLVM=1 and W=1 option, the following warning is generated: $ make -j12 W=1 LLVM=1 mm/zsmalloc.o mm/zsmalloc.c:455:20: error: function 'is_first_zpdesc' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] 455 | static inline bool is_first_zpdesc(struct zpdesc *zpdesc) | ^~~~~~~~~~~~~~~ 1 error generated. Fix the warning by adding __maybe_unused attribute to the function. No functional change intended. Link: https://lkml.kernel.org/r/[email protected] Fixes: c1b3bb7 ("mm/zsmalloc: use zpdesc in trylock_zspage()/lock_zspage()") Signed-off-by: Hyeonggon Yoo <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Cc: Alex Shi <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 1c7b17c commit 6e8e042

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/zsmalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static DEFINE_PER_CPU(struct mapping_area, zs_map_area) = {
452452
.lock = INIT_LOCAL_LOCK(lock),
453453
};
454454

455-
static inline bool is_first_zpdesc(struct zpdesc *zpdesc)
455+
static inline bool __maybe_unused is_first_zpdesc(struct zpdesc *zpdesc)
456456
{
457457
return PagePrivate(zpdesc_page(zpdesc));
458458
}

0 commit comments

Comments
 (0)