kexec: Remove the unnecessary conditional judgement to simplify the code logic
Subsystems (3)
PATCH 1/1 kexec: Remove the unnecessary conditional judgement to simplify the code logic
From: Minfei Huang <[email protected]>
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.
--- kernel/kexec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/kexec.c +1 -2
@@ -796,11 +796,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; }
Signature · 1 line
2.2.2
Quoted 18 lines · Minfei Huang
From: Minfei Huang <[email protected]>
Transforming PFN(Page Frame Number) to struct page is never failure, so we can simplify the code logic to do the
image->control_pageassignment directly in the loop, and remove the unnecessary conditional judgement.Signed-off-by Minfei Huang <[email protected]>--- kernel/kexec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/kexec.c +0
-0@@ -796,11 +796,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) {
kernel/kexec.c static struct page *kimage_alloc_crash_control_pages(struct kimage *image, · line 805
Quoted 10 lines
kernel/kexec.c +1
-2pages =pfn_to_page (hole_start >>PAGE_SHIFT ); + image->control_page = hole_end;break ; } } -if (pages) - image->control_page = hole_end;return pages; }
Thanks
Dave
Hi, Vivek.
Since Dave acked this patch, Could you help to merge it?
Thanks
Minfei
Quoted 34 lines · Dave Young
Quoted 18 lines · Minfei Huang
From: Minfei Huang <[email protected]>
Transforming PFN(Page Frame Number) to struct page is never failure, so we can simplify the code logic to do the
image->control_pageassignment directly in the loop, and remove the unnecessary conditional judgement.Signed-off-by Minfei Huang <[email protected]>--- kernel/kexec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/kexec.c +0
-0@@ -796,11 +796,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) {kernel/kexec.c static struct page *kimage_alloc_crash_control_pages(struct kimage *image, · line 805
Quoted 10 lines
kernel/kexec.c +1
-2pages =pfn_to_page (hole_start >>PAGE_SHIFT ); + image->control_page = hole_end;break ; } } -if (pages) - image->control_page = hole_end;return pages; }Acked-by Dave Young <[email protected]>Thanks
Dave
Quoted 7 lines · Minfei Huang
From: Minfei Huang <[email protected]>
Transforming PFN(Page Frame Number) to struct page is never failure, so we can simplify the code logic to do the
image->control_pageassignment directly in the loop, and remove the unnecessary conditional judgement.Signed-off-by Minfei Huang <[email protected]>
Looks good to me.
Thanks
Vivek
Quoted 23 lines
--- kernel/kexec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel/kexec.c +1
-2@@ -796,11 +796,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; }Signature · 1 line
2.2.2
Quoted 7 lines · Vivek Goyal
Quoted 6 lines · Minfei Huang
From: Minfei Huang <[email protected]>
Transforming PFN(Page Frame Number) to struct page is never failure, so we can simplify the code logic to do the
image->control_pageassignment directly in the loop, and remove the unnecessary conditional judgement.
Quoted 5 lines
Quoted 1 line
Signed-off-by Minfei Huang <[email protected]>Looks good to me.
Acked-by Vivek Goyal <[email protected]>
FWIW, this probably needs to be reposted to Andrew Morton with appropriate Acks and CCs in order to proceed into his tree and then Linus's.
Quoted 8 lines · Simon Horman
Quoted 7 lines · Vivek Goyal
Quoted 6 lines · Minfei Huang
From: Minfei Huang <[email protected]>
Transforming PFN(Page Frame Number) to struct page is never failure, so we can simplify the code logic to do the
image->control_pageassignment directly in the loop, and remove the unnecessary conditional judgement.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Minfei Huang <[email protected]>Looks good to me.
Acked-by Vivek Goyal <[email protected]>FWIW, this probably needs to be reposted to Andrew Morton with appropriate Acks and CCs in order to proceed into his tree and then Linus's.
Thanks.
I will repost it to Andrew Morton.
Thanks
Minfei