From f615f39616c4fd1a3a3b078af8d75bb4be6390de Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 26 May 2016 10:07:50 +0200 Subject: exec: remove ram_addr argument from qemu_ram_block_from_host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Of the two callers, one does not use it, and the other can compute it itself based on the other output argument (offset) and the RAMBlock. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- exec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 3330e7d0af..65bad53d80 100644 --- a/exec.c +++ b/exec.c @@ -1897,16 +1897,16 @@ static void *qemu_ram_ptr_length(RAMBlock *ram_block, ram_addr_t addr, * ram_addr_t. */ RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset, - ram_addr_t *ram_addr, ram_addr_t *offset) { RAMBlock *block; uint8_t *host = ptr; if (xen_enabled()) { + ram_addr_t ram_addr; rcu_read_lock(); - *ram_addr = xen_ram_addr_from_mapcache(ptr); - block = qemu_get_ram_block(*ram_addr); + ram_addr = xen_ram_addr_from_mapcache(ptr); + block = qemu_get_ram_block(ram_addr); if (block) { *offset = (host - block->host); } @@ -1938,7 +1938,6 @@ found: if (round_offset) { *offset &= TARGET_PAGE_MASK; } - *ram_addr = block->offset + *offset; rcu_read_unlock(); return block; } @@ -1968,10 +1967,10 @@ RAMBlock *qemu_ram_block_by_name(const char *name) MemoryRegion *qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr) { RAMBlock *block; - ram_addr_t offset; /* Not used */ - - block = qemu_ram_block_from_host(ptr, false, ram_addr, &offset); + ram_addr_t offset; + block = qemu_ram_block_from_host(ptr, false, &offset); + *ram_addr = block->offset + offset; if (!block) { return NULL; } -- cgit v1.2.3