]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86: Change get_max_mapped() to inline
authorYinghai Lu <yinghai@kernel.org>
Tue, 28 Dec 2010 00:47:54 +0000 (16:47 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 29 Dec 2010 23:47:55 +0000 (15:47 -0800)
Move it into head file. to prepare use it in other files.

[ hpa: added missing <linux/types.h> and changed type to phys_addr_t. ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4D1933BA.8000508@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/page_types.h
arch/x86/kernel/setup.c

index 1df66211fd1b53d4d6233cc1e481e88009622aab..93626e699679e2e0f56e561360ff63548d713161 100644 (file)
@@ -2,6 +2,7 @@
 #define _ASM_X86_PAGE_DEFS_H
 
 #include <linux/const.h>
+#include <linux/types.h>
 
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT     12
@@ -45,6 +46,11 @@ extern int devmem_is_allowed(unsigned long pagenr);
 extern unsigned long max_low_pfn_mapped;
 extern unsigned long max_pfn_mapped;
 
+static inline phys_addr_t get_max_mapped(void)
+{
+       return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT;
+}
+
 extern unsigned long init_memory_mapping(unsigned long start,
                                         unsigned long end);
 
index df172c1e823850e846a97b306d326e375a25086a..3def8c9a5dc91bb1b504e5a9d552e87014f5c1e6 100644 (file)
@@ -669,15 +669,6 @@ static int __init parse_reservelow(char *p)
 
 early_param("reservelow", parse_reservelow);
 
-static u64 __init get_max_mapped(void)
-{
-       u64 end = max_pfn_mapped;
-
-       end <<= PAGE_SHIFT;
-
-       return end;
-}
-
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures