aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpi_memhotplug.c5
-rw-r--r--drivers/base/memory.c5
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 01a1bd23926..2143609d293 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -200,8 +200,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
* Note: Assume that this function returns zero on success
*/
result = add_memory(mem_device->start_addr,
- (mem_device->end_addr - mem_device->start_addr) + 1,
- mem_device->read_write_attribute);
+ (mem_device->end_addr - mem_device->start_addr) + 1);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
mem_device->state = MEMORY_INVALID_STATE;
@@ -259,7 +258,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
* Ask the VM to offline this memory range.
* Note: Assume that this function returns zero on success
*/
- result = remove_memory(start, len, attr);
+ result = remove_memory(start, len);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Hot-Remove failed.\n"));
return_VALUE(result);
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 785cb6e6b91..b7ddd651d66 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -340,15 +340,12 @@ static int memory_probe_init(void)
static int add_memory_block(unsigned long node_id, struct mem_section *section,
unsigned long state, int phys_device)
{
- size_t size = sizeof(struct memory_block);
- struct memory_block *mem = kmalloc(size, GFP_KERNEL);
+ struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL);
int ret = 0;
if (!mem)
return -ENOMEM;
- memset(mem, 0, size);
-
mem->phys_index = __section_nr(section);
mem->state = state;
init_MUTEX(&mem->state_sem);