summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/dma-noncoherent.c
diff options
context:
space:
mode:
authorXishi Qiu <qiuxishi@huawei.com>2013-11-13 00:07:13 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 04:09:03 +0100
commitc1ce4b375fa7b76d8b553d4f8d6cc5a09f063691 (patch)
tree50ed8b8cdfbbd6ae59c99f9650a24192be3aa34b /arch/powerpc/mm/dma-noncoherent.c
parentmm/compaction.c: update comment about zone lock in isolate_freepages_block (diff)
downloadlinux-c1ce4b375fa7b76d8b553d4f8d6cc5a09f063691.tar.xz
linux-c1ce4b375fa7b76d8b553d4f8d6cc5a09f063691.zip
mm/arch: use __free_reserved_page() to simplify the code
Use __free_reserved_page() to simplify the code in arch. It used split_page() in consistent_alloc()/__dma_alloc_coherent()/dma_alloc_coherent(), so page->_count == 1, and we can free it safely. __free_reserved_page() ClearPageReserved() init_page_count() // it won't change the value __free_page() Signed-off-by: Xishi Qiu <qiuxishi@huawei.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc/mm/dma-noncoherent.c')
-rw-r--r--arch/powerpc/mm/dma-noncoherent.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
index 6747eece84af..7b6c10750179 100644
--- a/arch/powerpc/mm/dma-noncoherent.c
+++ b/arch/powerpc/mm/dma-noncoherent.c
@@ -287,9 +287,7 @@ void __dma_free_coherent(size_t size, void *vaddr)
pte_clear(&init_mm, addr, ptep);
if (pfn_valid(pfn)) {
struct page *page = pfn_to_page(pfn);
-
- ClearPageReserved(page);
- __free_page(page);
+ __free_reserved_page(page);
}
}
addr += PAGE_SIZE;