Commit 33af9039 authored by Andreas Herrmann's avatar Andreas Herrmann Committed by Ingo Molnar

x86: pat.c final cleanup of loop body in reserve_memtype

Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Suresh B Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 64fe44c3
...@@ -281,32 +281,24 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, ...@@ -281,32 +281,24 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
/* Search for existing mapping that overlaps the current range */ /* Search for existing mapping that overlaps the current range */
where = NULL; where = NULL;
list_for_each_entry(entry, &memtype_list, nd) { list_for_each_entry(entry, &memtype_list, nd) {
if (entry->start >= end) { if (end <= entry->start) {
where = entry->nd.prev; where = entry->nd.prev;
break; break;
} } else if (start <= entry->start) { /* end > entry->start */
if (start <= entry->start && end >= entry->start) {
err = chk_conflict(new, entry, new_type); err = chk_conflict(new, entry, new_type);
if (err) { if (!err) {
break; 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; break;
} } else if (start < entry->end) { /* start > entry->start */
if (start < entry->end) {
err = chk_conflict(new, entry, new_type); err = chk_conflict(new, entry, new_type);
if (err) { if (!err) {
break; 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; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment