Skip to content

Commit

Permalink
kexec: remove unnecessary test in kimage_alloc_crash_control_pages()
Browse files Browse the repository at this point in the history
Transforming PFN(Page Frame Number) to struct page is never failure, so we
can simplify the code logic to do the image->control_page assignment
directly in the loop, and remove the unnecessary conditional judgement.

Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Simon Horman <horms@verge.net.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Minfei Huang authored and Linus Torvalds committed Sep 10, 2015
1 parent 2965faa commit 04e9949
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/kexec_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,10 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
/* If I don't overlap any segments I have found my hole! */
if (i == image->nr_segments) {
pages = pfn_to_page(hole_start >> PAGE_SHIFT);
image->control_page = hole_end;
break;
}
}
if (pages)
image->control_page = hole_end;

return pages;
}
Expand Down

0 comments on commit 04e9949

Please sign in to comment.