Skip to content

Commit

Permalink
hugepage: move is_hugepage_on_freelist inside ifdef to avoid warning
Browse files Browse the repository at this point in the history
Fixes warning reported by Stephen Rothwell

mm/hugetlb.c:2950: warning: 'is_hugepage_on_freelist' defined but not used

for the !CONFIG_MEMORY_FAILURE case.

Signed-off-by: Andi Kleen <[email protected]>
  • Loading branch information
Andi Kleen committed Oct 8, 2010
1 parent 4e1c197 commit d5bd910
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,8 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
hugetlb_acct_memory(h, -(chg - freed));
}

#ifdef CONFIG_MEMORY_FAILURE

/* Should be called in hugetlb_lock */
static int is_hugepage_on_freelist(struct page *hpage)
{
Expand All @@ -2960,7 +2962,6 @@ static int is_hugepage_on_freelist(struct page *hpage)
return 0;
}

#ifdef CONFIG_MEMORY_FAILURE
/*
* This function is called from memory failure code.
* Assume the caller holds page lock of the head page.
Expand Down

0 comments on commit d5bd910

Please sign in to comment.