aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-10-30 16:37:52 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-11-03 09:42:52 -0500
commit379218511219feddb85fde6362c0eefd94dd4828 (patch)
tree8934e990ad5bed1fc3940e176937b6d9641496c7 /softmmu
parent2eba427eb1e9057ee6bd2b4e6c4c78cda3534bfe (diff)
exec: Remove dead code (CID 1432876)
We removed the global_locking field in commit 4174495408a, leaving dead code around the 'unlocked' variable. Remove it to fix the DEADCODE issue reported by Coverity (CID 1432876). Fixes: 4174495408a ("exec: Remove MemoryRegion::global_locking field") Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201030153752.1557776-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/physmem.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index a9adedb9f8..0b31be2928 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -2723,22 +2723,14 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)
static bool prepare_mmio_access(MemoryRegion *mr)
{
- bool unlocked = !qemu_mutex_iothread_locked();
bool release_lock = false;
- if (unlocked) {
+ if (!qemu_mutex_iothread_locked()) {
qemu_mutex_lock_iothread();
- unlocked = false;
release_lock = true;
}
if (mr->flush_coalesced_mmio) {
- if (unlocked) {
- qemu_mutex_lock_iothread();
- }
qemu_flush_coalesced_mmio_buffer();
- if (unlocked) {
- qemu_mutex_unlock_iothread();
- }
}
return release_lock;