diff options
author | Minfei Huang <mnfhuang@gmail.com> | 2015-08-25 14:21:37 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2015-08-25 14:21:37 +1000 |
commit | 51a09f94241b717cbe2544b9e19c43feccc6bbf3 (patch) | |
tree | 0f06bcd1458af790e07aa3739ff196bcfe6a6b39 | |
parent | 4268eebbbd6e3b2f5d366967c0983ad96d49e2f1 (diff) | |
download | linux-51a09f94241b717cbe2544b9e19c43feccc6bbf3.tar.gz linux-51a09f94241b717cbe2544b9e19c43feccc6bbf3.tar.xz |
kexec: remove unnecessary test in kimage_alloc_crash_control_pages()
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>
-rw-r--r-- | kernel/kexec_core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 9aa25c034b2e..9ffc96b65d9a 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -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; } |