summaryrefslogtreecommitdiff
path: root/arch/nios2/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-16 20:33:16 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-16 20:33:16 +0300
commit70f56cbbdc4ffccbea77e6f51ce9afcbda5fc20f (patch)
treeaee10162f35b757bf88d2a7dd0151abcf3ddc7ac /arch/nios2/include
parentde399813b521ea7e38bbfb5e5b620b5e202e5783 (diff)
parent744606c76c4a3a73eb34d21f265013426426c4b5 (diff)
downloadlinux-70f56cbbdc4ffccbea77e6f51ce9afcbda5fc20f.tar.xz
Merge tag 'nios2-v4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2
Pull arch/nios2 updates from Ley Foon Tan: - add screen_info - Convert pfn_valid to static inline - Extend !__ASSEMBLY__ section in asm/page.h * tag 'nios2-v4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: add screen_info nios2: Convert pfn_valid to static inline nios2: Extend !__ASSEMBLY__ section in asm/page.h
Diffstat (limited to 'arch/nios2/include')
-rw-r--r--arch/nios2/include/asm/page.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/nios2/include/asm/page.h b/arch/nios2/include/asm/page.h
index c1683f51ad0f..f1fbdc47bdaf 100644
--- a/arch/nios2/include/asm/page.h
+++ b/arch/nios2/include/asm/page.h
@@ -76,8 +76,6 @@ extern unsigned long memory_size;
extern struct page *mem_map;
-#endif /* !__ASSEMBLY__ */
-
# define __pa(x) \
((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
# define __va(x) \
@@ -87,8 +85,15 @@ extern struct page *mem_map;
((void *)(((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
# define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
-# define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && \
- (pfn) < max_mapnr)
+
+static inline bool pfn_valid(unsigned long pfn)
+{
+ /* avoid <linux/mm.h> include hell */
+ extern unsigned long max_mapnr;
+ unsigned long pfn_offset = ARCH_PFN_OFFSET;
+
+ return pfn >= pfn_offset && pfn < max_mapnr;
+}
# define virt_to_page(vaddr) pfn_to_page(PFN_DOWN(virt_to_phys(vaddr)))
# define virt_addr_valid(vaddr) pfn_valid(PFN_DOWN(virt_to_phys(vaddr)))
@@ -106,4 +111,6 @@ extern struct page *mem_map;
#include <asm-generic/getorder.h>
+#endif /* !__ASSEMBLY__ */
+
#endif /* _ASM_NIOS2_PAGE_H */