linux-mips
[Top] [All Lists]

[PATCH v2, part3 05/12] mm/powertv: use common help functions to free re

To: Andrew Morton <akpm@linux-foundation.org>, David Rientjes <rientjes@google.com>
Subject: [PATCH v2, part3 05/12] mm/powertv: use common help functions to free reserved pages
From: Jiang Liu <liuj97@gmail.com>
Date: Sun, 17 Mar 2013 01:03:26 +0800
Cc: Jiang Liu <jiang.liu@huawei.com>, Wen Congyang <wency@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>, Minchan Kim <minchan@kernel.org>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>, Michal Hocko <mhocko@suse.cz>, Jianguo Wu <wujianguo@huawei.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=RmA8l7civqvdKf/QFO54LzuLldXG+76wNfN0AWrmrQw=; b=trwhQSXpdV5R/FczsEaSIWOOEriFU3VnXlLF5eOcelMHyEz9cpjNamZZS2AjGRoblQ GrD7UBrXXK8q3TpTTcyWiuNHFBs9cg0P3+10HMpLgn7wVO48yom+6EXr3RuIc6Wav3FO Ecwqln/S+Yb77psF3tB1Zxq/XVIl2Z1OvwYDMfoDWYTD6QEa7vGBz2uNqLLGus8CnGHB KqY4xr0tmM8/VrVlOYkRsbZd5gYMuxOpgOuWtbHzjSUMLVOAJ4lYkSR2ZrOwxRdtwym/ Hf6Dr8I9X8JJ/WIbhWankj4d0AFNPiWGUrrgPteZOFb2ARbgwmDUPYjV45acBgOjQDe8 KmmQ==
In-reply-to: <1363453413-8139-1-git-send-email-jiang.liu@huawei.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1363453413-8139-1-git-send-email-jiang.liu@huawei.com>
Sender: linux-mips-bounce@linux-mips.org
Use common help functions to free reserved pages.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
---
 arch/mips/powertv/asic/asic_devices.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/mips/powertv/asic/asic_devices.c 
b/arch/mips/powertv/asic/asic_devices.c
index bce1872..746b06d 100644
--- a/arch/mips/powertv/asic/asic_devices.c
+++ b/arch/mips/powertv/asic/asic_devices.c
@@ -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);
 
-- 
1.7.9.5


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH v2, part3 05/12] mm/powertv: use common help functions to free reserved pages, Jiang Liu <=