[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/20] exec: Remove dead code (CID 1432876)
From: |
Paolo Bonzini |
Subject: |
[PULL 03/20] exec: Remove dead code (CID 1432876) |
Date: |
Wed, 4 Nov 2020 10:01:36 -0500 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
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>
---
softmmu/physmem.c | 10 +---------
1 file changed, 1 insertion(+), 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;
--
2.26.2
- [PULL 00/20] Misc patches for QEMU 5.2-rc1, Paolo Bonzini, 2020/11/04
- [PULL 03/20] exec: Remove dead code (CID 1432876),
Paolo Bonzini <=
- [PULL 01/20] cutils: replace strdup with g_strdup, Paolo Bonzini, 2020/11/04
- [PULL 09/20] tests/qtest/libqtest.c: Check for setsockopt() failure, Paolo Bonzini, 2020/11/04
- [PULL 02/20] docs: expand sourceset documentation, Paolo Bonzini, 2020/11/04
- [PULL 07/20] meson: use b_staticpic=false for meson >=0.56.0, Paolo Bonzini, 2020/11/04
- [PULL 10/20] tests/qtest/libqos/ahci.c: Avoid NULL dereference in ahci_exec(), Paolo Bonzini, 2020/11/04
- [PULL 06/20] qtest: add a reproducer for LP#1878642, Paolo Bonzini, 2020/11/04
- [PULL 12/20] configure: fix gio_libs reference, Paolo Bonzini, 2020/11/04
- [PULL 04/20] scripts/oss-fuzz: rename bin/qemu-fuzz-i386, Paolo Bonzini, 2020/11/04
- [PULL 16/20] fuzz: fuzz offsets within pio/mmio regions, Paolo Bonzini, 2020/11/04
- [PULL 08/20] meson: vhost-user-gpu/virtiofsd: use absolute path, Paolo Bonzini, 2020/11/04