diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2005-10-29 21:16:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 00:40:44 -0400 |
commit | 0b0acbec1bed75ec1e1daa7f7006323a2a2b2844 (patch) | |
tree | e0d54fbaa6b8b0955ed881af8956b4085039b2d1 /drivers/base | |
parent | 3947be1969a9ce455ec30f60ef51efb10e4323d1 (diff) |
[PATCH] memory hotplug: move section_mem_map alloc to sparse.c
This basically keeps up from having to extern __kmalloc_section_memmap().
The vaddr_in_vmalloc_area() helper could go in a vmalloc header, but that
header gets hard to work with, because it needs some arch-specific macros.
Just stick it in here for now, instead of creating another header.
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Lion Vollnhals <webmaster@schiggl.de>
Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/memory.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 785cb6e6b91c..b7ddd651d664 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -340,15 +340,12 @@ static int memory_probe_init(void) | |||
340 | static int add_memory_block(unsigned long node_id, struct mem_section *section, | 340 | static int add_memory_block(unsigned long node_id, struct mem_section *section, |
341 | unsigned long state, int phys_device) | 341 | unsigned long state, int phys_device) |
342 | { | 342 | { |
343 | size_t size = sizeof(struct memory_block); | 343 | struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL); |
344 | struct memory_block *mem = kmalloc(size, GFP_KERNEL); | ||
345 | int ret = 0; | 344 | int ret = 0; |
346 | 345 | ||
347 | if (!mem) | 346 | if (!mem) |
348 | return -ENOMEM; | 347 | return -ENOMEM; |
349 | 348 | ||
350 | memset(mem, 0, size); | ||
351 | |||
352 | mem->phys_index = __section_nr(section); | 349 | mem->phys_index = __section_nr(section); |
353 | mem->state = state; | 350 | mem->state = state; |
354 | init_MUTEX(&mem->state_sem); | 351 | init_MUTEX(&mem->state_sem); |