summaryrefslogtreecommitdiff
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorAndreas Herrmann <andreas.herrmann3@amd.com>2008-06-20 22:08:37 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-24 13:05:59 +0200
commit33af9039cbf629041da2bfa0cf451208391a1ec3 (patch)
tree0efbb4b05d89d38acc006b6f74ee6053e867571c /arch/x86/mm
parent64fe44c38bbdfab4fe052029058ce5fe9804de68 (diff)
x86: pat.c final cleanup of loop body in reserve_memtype
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Suresh B Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/pat.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 281ac6489c08..a885a1019b8a 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -281,32 +281,24 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
/* Search for existing mapping that overlaps the current range */
where = NULL;
list_for_each_entry(entry, &memtype_list, nd) {
- if (entry->start >= end) {
+ if (end <= entry->start) {
where = entry->nd.prev;
break;
- }
-
- if (start <= entry->start && end >= entry->start) {
+ } else if (start <= entry->start) { /* end > entry->start */
err = chk_conflict(new, entry, new_type);
- if (err) {
- break;
+ if (!err) {
+ dprintk("Overlap at 0x%Lx-0x%Lx\n",
+ entry->start, entry->end);
+ where = entry->nd.prev;
}
-
- dprintk("Overlap at 0x%Lx-0x%Lx\n",
- entry->start, entry->end);
- where = entry->nd.prev;
break;
- }
-
- if (start < entry->end) {
+ } else if (start < entry->end) { /* start > entry->start */
err = chk_conflict(new, entry, new_type);
- if (err) {
- break;
+ if (!err) {
+ dprintk("Overlap at 0x%Lx-0x%Lx\n",
+ entry->start, entry->end);
+ where = &entry->nd;
}
-
- dprintk("Overlap at 0x%Lx-0x%Lx\n",
- entry->start, entry->end);
- where = &entry->nd;
break;
}
}