From d52f55b46dd031e34265f8f92e3069b98cf982a8 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Sat, 17 Feb 2018 19:39:20 -0500 Subject: [PATCH] memory: Eliminate memory_region_destructor_ram_from_ptr() The function is equivalent to memory_region_destructor_ram(), so it's not needed anymore. Backports commit fc3e7665d7fe1b2f842441d250d7afec26b8a910 from qemu --- qemu/memory.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/qemu/memory.c b/qemu/memory.c index 0b4b7e1c..e0d63742 100644 --- a/qemu/memory.c +++ b/qemu/memory.c @@ -822,11 +822,6 @@ static void memory_region_destructor_alias(MemoryRegion *mr) memory_region_unref(mr->alias); } -static void memory_region_destructor_ram_from_ptr(MemoryRegion *mr) -{ - qemu_ram_free(mr->uc, mr->ram_addr); -} - static bool memory_region_need_escape(char c) { return c == '/' || c == '[' || c == '\\' || c == ']'; @@ -1178,7 +1173,7 @@ void memory_region_init_ram_ptr(struct uc_struct *uc, MemoryRegion *mr, memory_region_init(uc, mr, owner, name, size); mr->ram = true; mr->terminates = true; - mr->destructor = memory_region_destructor_ram_from_ptr; + mr->destructor = memory_region_destructor_ram; mr->dirty_log_mask = tcg_enabled(uc) ? (1 << DIRTY_MEMORY_CODE) : 0; /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL. */