lkml.org 
[lkml]   [2011]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/11] x86: Change get_max_mapped() to inline
    Date
    Move it into head file. to prepare use it in other files.

    -v2: hpa pointed out that u64 should not be used here.
    Actually We could unsigned long here. because for 32bit it will under 4g.

    Signed-off-by: Yinghai Lu <yinghai@kernel.org>
    ---
    arch/x86/include/asm/page_types.h | 5 +++++
    arch/x86/kernel/setup.c | 9 ---------
    2 files changed, 5 insertions(+), 9 deletions(-)

    diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
    index 1df6621..cf271fd 100644
    --- a/arch/x86/include/asm/page_types.h
    +++ b/arch/x86/include/asm/page_types.h
    @@ -45,6 +45,11 @@ extern int devmem_is_allowed(unsigned long pagenr);
    extern unsigned long max_low_pfn_mapped;
    extern unsigned long max_pfn_mapped;

    +static inline unsigned long get_max_mapped(void)
    +{
    + return max_pfn_mapped<<PAGE_SHIFT;
    +}
    +
    extern unsigned long init_memory_mapping(unsigned long start,
    unsigned long end);

    diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
    index d3cfe26..23a7a5f 100644
    --- a/arch/x86/kernel/setup.c
    +++ b/arch/x86/kernel/setup.c
    @@ -680,15 +680,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
    --
    1.7.1


    \
     
     \ /
      Last update: 2011-02-08 00:55    [W:0.035 / U:31.724 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site