linux-mips
[Top] [All Lists]

[PATCH v4, part3 06/15] mm, powertv: use free_reserved_area() to simplif

To: Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH v4, part3 06/15] mm, powertv: use free_reserved_area() to simplify code
From: Jiang Liu <liuj97@gmail.com>
Date: Sat, 6 Apr 2013 21:55:00 +0800
Cc: Jiang Liu <jiang.liu@huawei.com>, David Rientjes <rientjes@google.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>, James Bottomley <James.Bottomley@HansenPartnership.com>, Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>, David Howells <dhowells@redhat.com>, Mark Salter <msalter@redhat.com>, Jianguo Wu <wujianguo@huawei.com>, linux-mm@kvack.org, linux-arch@vger.kernel.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=AaHjsGPm0uU8h9VEmFnPm/QOR8wfJFDCmOt3TAHGp/0=; b=eItVHEaEl2Np9xPsiIst2CKdnZwRKr8L+u58sH5SfijhIwRCqtcgCNpGjSBQm5jq+/ nOCO1cGbApWBuE8ndCgteUr+yEwpcyHS+m/io2AZgagwKm30tJz3RJ6GxZHjMxsTL8Wd cKPbC8Y/FjdRCXQ7OrXh3WOMCm0JoV33D0uddjRG7m4c2UPWA4/uoOEYcP38NsxtsTGl r5IT05Sigix4EmMJQDTCHQoTgtr+1XguZVS2Uqj0usj+ueu31K0S0uOkWPQaVQoyYzSB bl+nYNhyXVvp2KnMG+up8gBQb4HCFffypZXg0CcXsPcC/n+NB8RddlCzqDNFl7B15iN8 UNfA==
In-reply-to: <1365256509-29024-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>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1365256509-29024-1-git-send-email-jiang.liu@huawei.com>
Sender: linux-mips-bounce@linux-mips.org
Use common help function free_reserved_area() to simplify code.

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 d38b095..9f64c23 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 v4, part3 06/15] mm, powertv: use free_reserved_area() to simplify code, Jiang Liu <=