* [PATCH v8, part3 06/14] mm, acornfb: use free_reserved_area() to simplify code
[not found] <1369575522-26405-1-git-send-email-jiang.liu@huawei.com>
@ 2013-05-26 13:38 ` Jiang Liu
2013-05-30 21:58 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Jiang Liu @ 2013-05-26 13:38 UTC (permalink / raw)
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, linux-arch,
linux-kernel, Florian Tobias Schandinat, linux-fbdev
Use common help function free_reserved_area() to simplify code.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/video/acornfb.c | 45 ++++++---------------------------------------
1 file changed, 6 insertions(+), 39 deletions(-)
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 6488a73..8f7374f 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1180,42 +1180,6 @@ static int acornfb_detect_monitortype(void)
return 4;
}
-/*
- * This enables the unused memory to be freed on older Acorn machines.
- * We are freeing memory on behalf of the architecture initialisation
- * code here.
- */
-static inline void
-free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
-{
- int mb_freed = 0;
-
- /*
- * Align addresses
- */
- virtual_start = PAGE_ALIGN(virtual_start);
- virtual_end = PAGE_ALIGN(virtual_end);
-
- while (virtual_start < virtual_end) {
- struct page *page;
-
- /*
- * Clear page reserved bit,
- * set count to 1, and free
- * the page.
- */
- page = virt_to_page(virtual_start);
- ClearPageReserved(page);
- init_page_count(page);
- free_page(virtual_start);
-
- virtual_start += PAGE_SIZE;
- mb_freed += PAGE_SIZE / 1024;
- }
-
- printk("acornfb: freed %dK memory\n", mb_freed);
-}
-
static int acornfb_probe(struct platform_device *dev)
{
unsigned long size;
@@ -1312,10 +1276,13 @@ static int acornfb_probe(struct platform_device *dev)
#endif
#if defined(HAS_VIDC)
/*
- * Archimedes/A5000 machines use a fixed address for their
- * framebuffers. Free unused pages
+ * We are freeing memory on behalf of the architecture initialisation
+ * code here. Archimedes/A5000 machines use a fixed address for their
+ * framebuffers.
*/
- free_unused_pages(PAGE_OFFSET + size, PAGE_OFFSET + MAX_SIZE);
+ free_reserved_area((void *)(PAGE_OFFSET + size),
+ (void *)PAGE_ALIGN(PAGE_OFFSET + MAX_SIZE),
+ -1, "acornfb");
#endif
fb_info.fix.smem_len = size;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v8, part3 06/14] mm, acornfb: use free_reserved_area() to simplify code
2013-05-26 13:38 ` [PATCH v8, part3 06/14] mm, acornfb: use free_reserved_area() to simplify code Jiang Liu
@ 2013-05-30 21:58 ` Andrew Morton
2013-05-31 4:31 ` Jiang Liu
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2013-05-30 21:58 UTC (permalink / raw)
To: Jiang Liu
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, linux-arch,
linux-kernel, Florian Tobias Schandinat, linux-fbdev
On Sun, 26 May 2013 21:38:34 +0800 Jiang Liu <liuj97@gmail.com> wrote:
> Use common help function free_reserved_area() to simplify code.
http://ozlabs.org/~akpm/mmots/broken-out/drivers-video-acornfbc-remove-dead-code.patch
removes all the code which your patch alters.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v8, part3 06/14] mm, acornfb: use free_reserved_area() to simplify code
2013-05-30 21:58 ` Andrew Morton
@ 2013-05-31 4:31 ` Jiang Liu
0 siblings, 0 replies; 3+ messages in thread
From: Jiang Liu @ 2013-05-31 4:31 UTC (permalink / raw)
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, linux-arch,
linux-kernel, Florian Tobias Schandinat, linux-fbdev
On Fri 31 May 2013 05:58:44 AM CST, Andrew Morton wrote:
> On Sun, 26 May 2013 21:38:34 +0800 Jiang Liu <liuj97@gmail.com> wrote:
>
>> Use common help function free_reserved_area() to simplify code.
>
> http://ozlabs.org/~akpm/mmots/broken-out/drivers-video-acornfbc-remove-dead-code.patch
> removes all the code which your patch alters.
Thanks Andrew, please just drop that patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-31 4:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1369575522-26405-1-git-send-email-jiang.liu@huawei.com>
2013-05-26 13:38 ` [PATCH v8, part3 06/14] mm, acornfb: use free_reserved_area() to simplify code Jiang Liu
2013-05-30 21:58 ` Andrew Morton
2013-05-31 4:31 ` Jiang Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).