[RFC][PATCH] unify pfn_to_page [7/25] h8300 pfn_to_page/page_to_pfn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks complicated..
original page_to_pfn() was
(((page - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) >> PAGE_SHIFT.
This is same to
(unsigned long) (page - mem_map) + (PAGE_OFFSET >> PAGE_SHIFT).

h8300 can use generic ones.
Signed-Off-By: KAMEZAWA Hiruyoki <[email protected]>

Index: cleanup_pfn_page/include/asm-h8300/page.h
===================================================================
--- cleanup_pfn_page.orig/include/asm-h8300/page.h
+++ cleanup_pfn_page/include/asm-h8300/page.h
@@ -71,8 +71,7 @@ extern unsigned long memory_end;
 #define page_to_virt(page)	((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
 #define pfn_valid(page)	        (page < max_mapnr)

-#define pfn_to_page(pfn)	virt_to_page(pfn_to_virt(pfn))
-#define page_to_pfn(page)	virt_to_pfn(page_to_virt(page))
+#define ARCH_PFN_OFFSET		(PAGE_OFFSET >> PAGE_SHIFT)

 #define	virt_addr_valid(kaddr)	(((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
 				((void *)(kaddr) < (void *)memory_end))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux