Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756107Ab3EQPqU (ORCPT ); Fri, 17 May 2013 11:46:20 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:52828 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754250Ab3EQPqS (ORCPT ); Fri, 17 May 2013 11:46:18 -0400 From: Jiang Liu To: Andrew Morton Cc: Jiang Liu , David Rientjes , Wen Congyang , Mel Gorman , Minchan Kim , KAMEZAWA Hiroyuki , Michal Hocko , James Bottomley , Sergei Shtylyov , David Howells , Mark Salter , Jianguo Wu , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Ralf Baechle , linux-mips@linux-mips.org Subject: [PATCH v7, part3 06/16] mm, powertv: use free_reserved_area() to simplify code Date: Fri, 17 May 2013 23:45:08 +0800 Message-Id: <1368805518-2634-7-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1368805518-2634-1-git-send-email-jiang.liu@huawei.com> References: <1368805518-2634-1-git-send-email-jiang.liu@huawei.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1418 Lines: 43 Use common help function free_reserved_area() to simplify code. Signed-off-by: Jiang Liu Cc: Ralf Baechle Cc: Jiang Liu 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.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/