mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 16:38:12 +00:00
x86/mm/pat: Simplify the free_memtype() control flow
Simplify/streamline the quirky handling of the pat_pagerange_is_ram() logic, and get rid of the 'err' local variable. Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
ef35b0fcee
commit
47553d42c5
1 changed files with 3 additions and 8 deletions
|
@ -656,7 +656,6 @@ int reserve_memtype(u64 start, u64 end, enum page_cache_mode req_type,
|
|||
|
||||
int free_memtype(u64 start, u64 end)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
int is_range_ram;
|
||||
struct memtype *entry;
|
||||
|
||||
|
@ -671,14 +670,10 @@ int free_memtype(u64 start, u64 end)
|
|||
return 0;
|
||||
|
||||
is_range_ram = pat_pagerange_is_ram(start, end);
|
||||
if (is_range_ram == 1) {
|
||||
|
||||
err = free_ram_pages_type(start, end);
|
||||
|
||||
return err;
|
||||
} else if (is_range_ram < 0) {
|
||||
if (is_range_ram == 1)
|
||||
return free_ram_pages_type(start, end);
|
||||
if (is_range_ram < 0)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock(&memtype_lock);
|
||||
entry = memtype_erase(start, end);
|
||||
|
|
Loading…
Reference in a new issue