aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzijun_hu <zijun_hu@htc.com>2016-10-07 19:59:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:28 -0400
commit2382705f22c1436a153800cf6051b08f0ea14838 (patch)
tree3b5f0791a5a7a109be31272aaa363012c8d7e4bb
parent1e76609cc1646c5222feefe86a3433a79be4fb73 (diff)
mm/nobootmem.c: remove duplicate macro ARCH_LOW_ADDRESS_LIMIT statements
Fix the following bugs: - the same ARCH_LOW_ADDRESS_LIMIT statements are duplicated between header and relevant source - don't ensure ARCH_LOW_ADDRESS_LIMIT perhaps defined by ARCH in asm/processor.h is preferred over default in linux/bootmem.h completely since the former header isn't included by the latter Link: http://lkml.kernel.org/r/e046aeaa-e160-6d9e-dc1b-e084c2fd999f@zoho.com Signed-off-by: zijun_hu <zijun_hu@htc.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/bootmem.h9
-rw-r--r--mm/nobootmem.c10
2 files changed, 10 insertions, 9 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index f9be32691718..962164d36506 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -7,6 +7,7 @@
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/mm_types.h> 8#include <linux/mm_types.h>
9#include <asm/dma.h> 9#include <asm/dma.h>
10#include <asm/processor.h>
10 11
11/* 12/*
12 * simple boot-time physical memory area allocator. 13 * simple boot-time physical memory area allocator.
@@ -119,6 +120,10 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
119#define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS) 120#define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS)
120#endif 121#endif
121 122
123#ifndef ARCH_LOW_ADDRESS_LIMIT
124#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
125#endif
126
122#define alloc_bootmem(x) \ 127#define alloc_bootmem(x) \
123 __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) 128 __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
124#define alloc_bootmem_align(x, align) \ 129#define alloc_bootmem_align(x, align) \
@@ -180,10 +185,6 @@ static inline void * __init memblock_virt_alloc_nopanic(
180 NUMA_NO_NODE); 185 NUMA_NO_NODE);
181} 186}
182 187
183#ifndef ARCH_LOW_ADDRESS_LIMIT
184#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
185#endif
186
187static inline void * __init memblock_virt_alloc_low( 188static inline void * __init memblock_virt_alloc_low(
188 phys_addr_t size, phys_addr_t align) 189 phys_addr_t size, phys_addr_t align)
189{ 190{
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index bd05a70f44b9..490d46abddad 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -11,18 +11,21 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/pfn.h> 12#include <linux/pfn.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/bootmem.h>
15#include <linux/export.h> 14#include <linux/export.h>
16#include <linux/kmemleak.h> 15#include <linux/kmemleak.h>
17#include <linux/range.h> 16#include <linux/range.h>
18#include <linux/memblock.h> 17#include <linux/memblock.h>
18#include <linux/bootmem.h>
19 19
20#include <asm/bug.h> 20#include <asm/bug.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/processor.h>
23 22
24#include "internal.h" 23#include "internal.h"
25 24
25#ifndef CONFIG_HAVE_MEMBLOCK
26#error CONFIG_HAVE_MEMBLOCK not defined
27#endif
28
26#ifndef CONFIG_NEED_MULTIPLE_NODES 29#ifndef CONFIG_NEED_MULTIPLE_NODES
27struct pglist_data __refdata contig_page_data; 30struct pglist_data __refdata contig_page_data;
28EXPORT_SYMBOL(contig_page_data); 31EXPORT_SYMBOL(contig_page_data);
@@ -395,9 +398,6 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
395 return __alloc_bootmem_node(pgdat, size, align, goal); 398 return __alloc_bootmem_node(pgdat, size, align, goal);
396} 399}
397 400
398#ifndef ARCH_LOW_ADDRESS_LIMIT
399#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
400#endif
401 401
402/** 402/**
403 * __alloc_bootmem_low - allocate low boot memory 403 * __alloc_bootmem_low - allocate low boot memory