Commit 6e7582bf authored by Jiang Liu's avatar Jiang Liu Committed by Ralf Baechle

MIPS: PowerTV: use free_reserved_area() to simplify code

Use common help function free_reserved_area() to simplify code.
Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Minchan Kim <minchan@kernel.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Cc: linux-mm@kvack.org
Cc: linux-arch@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/5248/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 317ddd25
......@@ -529,17 +529,8 @@ EXPORT_SYMBOL(asic_resource_get);
*/
void platform_release_memory(void *ptr, int size)
{
unsigned long addr;
unsigned long end;
addr = ((unsigned long)ptr + (PAGE_SIZE - 1)) & PAGE_MASK;
end = ((unsigned long)ptr + size) & PAGE_MASK;
for (; addr < end; addr += PAGE_SIZE) {
ClearPageReserved(virt_to_page(__va(addr)));
init_page_count(virt_to_page(__va(addr)));
free_page((unsigned long)__va(addr));
}
free_reserved_area((unsigned long)ptr, (unsigned long)(ptr + size),
-1, NULL);
}
EXPORT_SYMBOL(platform_release_memory);
......
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