Skip to contentSkip to conversation

mm: mminit_validate_memmodel_limits - get rid of redundant test

PATCH In review Cyrill Gorcunov 2 participants 2 messages Jan 6, 2009

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

PATCH 1/1 mm: mminit_validate_memmodel_limits - get rid of redundant test

In case if start_pfn overlap the upper bound no need to test end_pfn again since we have it already trimmed.

---

I hope this time I don't miss anything.

 mm/sparse.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/sparse.c +1 -3
Index: linux-2.6.git/mm/sparse.c
===================================================================
@@ -164,9 +164,7 @@ void __meminit mminit_validate_memmodel_
 		WARN_ON_ONCE(1);
 		*start_pfn = max_sparsemem_pfn;
 		*end_pfn = max_sparsemem_pfn;
-	}
-
-	if (*end_pfn > max_sparsemem_pfn) {
+	} else if (*end_pfn > max_sparsemem_pfn) {
 		mminit_dprintk(MMINIT_WARNING, "pfnvalidation",
 			"End of range %lu -> %lu exceeds SPARSEMEM max %lu\n",
 			*start_pfn, *end_pfn, max_sparsemem_pfn);