Skip to contentSkip to conversation

KEXEC: Get rid of duplicate check for hole_end

PATCH In review Zhang Yanfei 2 participants 2 messages Jan 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KEXEC: Get rid of duplicate check for hole_end

hole_end has been checked to make sure it is <= crash_res.end in the while condition check, so the if condition check is duplicate.

---
 kernel/kexec.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
kernel/kexec.c +0 -2
index 5e4bd78..c2826fc 100644
@@ -497,8 +497,6 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
 
 		if (hole_end > KEXEC_CRASH_CONTROL_MEMORY_LIMIT)
 			break;
-		if (hole_end > crashk_res.end)
-			break;
 		/* See if I overlap any of the segments */
 		for (i = 0; i < image->nr_segments; i++) {
 			unsigned long mstart, mend;
Signature · 1 line
1.7.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Zhang Yanfei

hole_end has been checked to make sure it is <= crash_res.end in the while condition check, so the if condition check is duplicate.

That test is definitely a duplicate.

Quoted 18 lines
---
 kernel/kexec.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
kernel/kexec.c +0 -2
index 5e4bd78..c2826fc 100644
@@ -497,8 +497,6 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
 
 		if (hole_end > KEXEC_CRASH_CONTROL_MEMORY_LIMIT)
 			break;
-		if (hole_end > crashk_res.end)
-			break;
 		/* See if I overlap any of the segments */
 		for (i = 0; i < image->nr_segments; i++) {
 			unsigned long mstart, mend;