diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-07-28 00:31:29 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-08-04 22:56:11 -0400 |
commit | 4734b594c6ca1be796d30c82d93fdf5160f45124 (patch) | |
tree | 72443c76c7d4c0cade456cc21997f383417747de | |
parent | 9d3c30f5a17ec35894eadb7171f724643dce19c3 (diff) |
memblock: Remove memblock_type.size and add memblock.memory_size instead
Right now, both the "memory" and "reserved" memblock_type structures have
a "size" member. It represents the calculated memory size in the former
case and is unused in the latter.
This moves it out to the main memblock structure instead
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/mm/mem.c | 2 | ||||
-rw-r--r-- | include/linux/memblock.h | 2 | ||||
-rw-r--r-- | mm/memblock.c | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 52df5428ece4..f661f6c527da 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -301,7 +301,7 @@ void __init mem_init(void) | |||
301 | swiotlb_init(1); | 301 | swiotlb_init(1); |
302 | #endif | 302 | #endif |
303 | 303 | ||
304 | num_physpages = memblock.memory.size >> PAGE_SHIFT; | 304 | num_physpages = memblock_phys_mem_size() >> PAGE_SHIFT; |
305 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); | 305 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); |
306 | 306 | ||
307 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 307 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 0fe6dd56a4b4..c9c7b0f344a5 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -27,12 +27,12 @@ struct memblock_region { | |||
27 | 27 | ||
28 | struct memblock_type { | 28 | struct memblock_type { |
29 | unsigned long cnt; | 29 | unsigned long cnt; |
30 | phys_addr_t size; | ||
31 | struct memblock_region regions[MAX_MEMBLOCK_REGIONS+1]; | 30 | struct memblock_region regions[MAX_MEMBLOCK_REGIONS+1]; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | struct memblock { | 33 | struct memblock { |
35 | phys_addr_t current_limit; | 34 | phys_addr_t current_limit; |
35 | phys_addr_t memory_size; /* Updated by memblock_analyze() */ | ||
36 | struct memblock_type memory; | 36 | struct memblock_type memory; |
37 | struct memblock_type reserved; | 37 | struct memblock_type reserved; |
38 | }; | 38 | }; |
diff --git a/mm/memblock.c b/mm/memblock.c index 81da63592a68..5ae413e9afd8 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -49,7 +49,7 @@ void memblock_dump_all(void) | |||
49 | return; | 49 | return; |
50 | 50 | ||
51 | pr_info("MEMBLOCK configuration:\n"); | 51 | pr_info("MEMBLOCK configuration:\n"); |
52 | pr_info(" memory.size = 0x%llx\n", (unsigned long long)memblock.memory.size); | 52 | pr_info(" memory size = 0x%llx\n", (unsigned long long)memblock.memory_size); |
53 | 53 | ||
54 | memblock_dump(&memblock.memory, "memory"); | 54 | memblock_dump(&memblock.memory, "memory"); |
55 | memblock_dump(&memblock.reserved, "reserved"); | 55 | memblock_dump(&memblock.reserved, "reserved"); |
@@ -123,10 +123,10 @@ void __init memblock_analyze(void) | |||
123 | { | 123 | { |
124 | int i; | 124 | int i; |
125 | 125 | ||
126 | memblock.memory.size = 0; | 126 | memblock.memory_size = 0; |
127 | 127 | ||
128 | for (i = 0; i < memblock.memory.cnt; i++) | 128 | for (i = 0; i < memblock.memory.cnt; i++) |
129 | memblock.memory.size += memblock.memory.regions[i].size; | 129 | memblock.memory_size += memblock.memory.regions[i].size; |
130 | } | 130 | } |
131 | 131 | ||
132 | static long memblock_add_region(struct memblock_type *type, phys_addr_t base, phys_addr_t size) | 132 | static long memblock_add_region(struct memblock_type *type, phys_addr_t base, phys_addr_t size) |
@@ -423,7 +423,7 @@ phys_addr_t __init __memblock_alloc_base(phys_addr_t size, phys_addr_t align, ph | |||
423 | /* You must call memblock_analyze() before this. */ | 423 | /* You must call memblock_analyze() before this. */ |
424 | phys_addr_t __init memblock_phys_mem_size(void) | 424 | phys_addr_t __init memblock_phys_mem_size(void) |
425 | { | 425 | { |
426 | return memblock.memory.size; | 426 | return memblock.memory_size; |
427 | } | 427 | } |
428 | 428 | ||
429 | phys_addr_t memblock_end_of_DRAM(void) | 429 | phys_addr_t memblock_end_of_DRAM(void) |