提交 e70bd116 编写于 作者: G Greg Ungerer 提交者: Linus Torvalds

[PATCH] m68knommu: need pfn_valid macro

Need pfn_valid macro, even on MMUless platforms.
Enclose the macro args of __pa and __va in parentheses.
Signed-off-by: NGreg Ungerer <gerg@uclinux.com>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8410a546
...@@ -73,8 +73,8 @@ extern unsigned long memory_end; ...@@ -73,8 +73,8 @@ extern unsigned long memory_end;
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define __pa(vaddr) virt_to_phys((void *)vaddr) #define __pa(vaddr) virt_to_phys((void *)(vaddr))
#define __va(paddr) phys_to_virt((unsigned long)paddr) #define __va(paddr) phys_to_virt((unsigned long)(paddr))
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
...@@ -84,6 +84,7 @@ extern unsigned long memory_end; ...@@ -84,6 +84,7 @@ extern unsigned long memory_end;
#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) #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 page_to_pfn(page) virt_to_pfn(page_to_virt(page))
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
((void *)(kaddr) < (void *)memory_end)) ((void *)(kaddr) < (void *)memory_end))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册