diff options
author | Andreas Herrmann <andreas.herrmann3@amd.com> | 2008-06-20 16:08:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-24 07:05:59 -0400 |
commit | 33af9039cbf629041da2bfa0cf451208391a1ec3 (patch) | |
tree | 0efbb4b05d89d38acc006b6f74ee6053e867571c /arch | |
parent | 64fe44c38bbdfab4fe052029058ce5fe9804de68 (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')
-rw-r--r-- | arch/x86/mm/pat.c | 30 |
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, | |||
281 | /* Search for existing mapping that overlaps the current range */ | 281 | /* Search for existing mapping that overlaps the current range */ |
282 | where = NULL; | 282 | where = NULL; |
283 | list_for_each_entry(entry, &memtype_list, nd) { | 283 | list_for_each_entry(entry, &memtype_list, nd) { |
284 | if (entry->start >= end) { | 284 | if (end <= entry->start) { |
285 | where = entry->nd.prev; | 285 | where = entry->nd.prev; |
286 | break; | 286 | break; |
287 | } | 287 | } else if (start <= entry->start) { /* end > entry->start */ |
288 | |||
289 | if (start <= entry->start && end >= entry->start) { | ||
290 | err = chk_conflict(new, entry, new_type); | 288 | err = chk_conflict(new, entry, new_type); |
291 | if (err) { | 289 | if (!err) { |
292 | break; | 290 | dprintk("Overlap at 0x%Lx-0x%Lx\n", |
291 | entry->start, entry->end); | ||
292 | where = entry->nd.prev; | ||
293 | } | 293 | } |
294 | |||
295 | dprintk("Overlap at 0x%Lx-0x%Lx\n", | ||
296 | entry->start, entry->end); | ||
297 | where = entry->nd.prev; | ||
298 | break; | 294 | break; |
299 | } | 295 | } else if (start < entry->end) { /* start > entry->start */ |
300 | |||
301 | if (start < entry->end) { | ||
302 | err = chk_conflict(new, entry, new_type); | 296 | err = chk_conflict(new, entry, new_type); |
303 | if (err) { | 297 | if (!err) { |
304 | break; | 298 | dprintk("Overlap at 0x%Lx-0x%Lx\n", |
299 | entry->start, entry->end); | ||
300 | where = &entry->nd; | ||
305 | } | 301 | } |
306 | |||
307 | dprintk("Overlap at 0x%Lx-0x%Lx\n", | ||
308 | entry->start, entry->end); | ||
309 | where = &entry->nd; | ||
310 | break; | 302 | break; |
311 | } | 303 | } |
312 | } | 304 | } |