Skip to content

Commit

Permalink
mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning
Browse files Browse the repository at this point in the history
is_first_page() is only called from the macro VM_BUG_ON_PAGE() which is
only compiled in as a runtime check when CONFIG_DEBUG_VM is set,
otherwise is checked at compile time and not actually compiled in.

Fixes the following warning, found with Clang:

  mm/zsmalloc.c:472:12: warning: function 'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration]
  static int is_first_page(struct page *page)
           ^

Link: http://lkml.kernel.org/r/20170524053859.29059-1-nick.desaulniers@gmail.com
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
nickdesaulniers authored and torvalds committed Jul 10, 2017
1 parent dbac61a commit 3457f41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static bool is_zspage_isolated(struct zspage *zspage)
return zspage->isolated;
}

static int is_first_page(struct page *page)
static __maybe_unused int is_first_page(struct page *page)
{
return PagePrivate(page);
}
Expand Down

0 comments on commit 3457f41

Please sign in to comment.