Skip to content

Commit

Permalink
hugetlb: fix sparse warnings
Browse files Browse the repository at this point in the history
Fix the following sparse warnings:

  mm/hugetlb.c:375:3: warning: returning void-valued expression
  mm/hugetlb.c:408:3: warning: returning void-valued expression

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hannes Eder authored and Linus Torvalds committed Jan 6, 2009
1 parent f0d7a4b commit ebdd4ae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,10 @@ static void clear_huge_page(struct page *page,
{
int i;

if (unlikely(sz > MAX_ORDER_NR_PAGES))
return clear_gigantic_page(page, addr, sz);
if (unlikely(sz > MAX_ORDER_NR_PAGES)) {
clear_gigantic_page(page, addr, sz);
return;
}

might_sleep();
for (i = 0; i < sz/PAGE_SIZE; i++) {
Expand Down Expand Up @@ -433,8 +435,10 @@ static void copy_huge_page(struct page *dst, struct page *src,
int i;
struct hstate *h = hstate_vma(vma);

if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES))
return copy_gigantic_page(dst, src, addr, vma);
if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES)) {
copy_gigantic_page(dst, src, addr, vma);
return;
}

might_sleep();
for (i = 0; i < pages_per_huge_page(h); i++) {
Expand Down

0 comments on commit ebdd4ae

Please sign in to comment.