[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/32] hw/virtio/vhost: Silence compiler warnings in vhost code wh
|
From: |
Markus Armbruster |
|
Subject: |
[PULL 08/32] hw/virtio/vhost: Silence compiler warnings in vhost code when using -Wshadow |
|
Date: |
Fri, 6 Oct 2023 13:36:33 +0200 |
From: Thomas Huth <thuth@redhat.com>
Rename a variable in vhost_dev_sync_region() and remove a superfluous
declaration in vhost_commit() to make this code compilable with "-Wshadow".
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20231004114809.105672-1-thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/virtio/vhost.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index e2f6ffb446..9cfac40fde 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -66,12 +66,12 @@ static void vhost_dev_sync_region(struct vhost_dev *dev,
uint64_t mfirst, uint64_t mlast,
uint64_t rfirst, uint64_t rlast)
{
- vhost_log_chunk_t *log = dev->log->log;
+ vhost_log_chunk_t *dev_log = dev->log->log;
uint64_t start = MAX(mfirst, rfirst);
uint64_t end = MIN(mlast, rlast);
- vhost_log_chunk_t *from = log + start / VHOST_LOG_CHUNK;
- vhost_log_chunk_t *to = log + end / VHOST_LOG_CHUNK + 1;
+ vhost_log_chunk_t *from = dev_log + start / VHOST_LOG_CHUNK;
+ vhost_log_chunk_t *to = dev_log + end / VHOST_LOG_CHUNK + 1;
uint64_t addr = QEMU_ALIGN_DOWN(start, VHOST_LOG_CHUNK);
if (end < start) {
@@ -549,7 +549,7 @@ static void vhost_commit(MemoryListener *listener)
changed = true;
} else {
/* Same size, lets check the contents */
- for (int i = 0; i < n_old_sections; i++) {
+ for (i = 0; i < n_old_sections; i++) {
if (!MemoryRegionSection_eq(&old_sections[i],
&dev->mem_sections[i])) {
changed = true;
--
2.41.0
- [PULL 22/32] semihosting/arm-compat: Clean up local variable shadowing, (continued)
- [PULL 22/32] semihosting/arm-compat: Clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 20/32] util/cutils: Clean up global variable shadowing in get_relocated_path(), Markus Armbruster, 2023/10/06
- [PULL 25/32] trace/control: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 28/32] linux-user/flatload: clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 17/32] qom/object_interfaces: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 24/32] sysemu/tpm: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 30/32] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm(), Markus Armbruster, 2023/10/06
- [PULL 02/32] target/loongarch: Clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 11/32] hw/ide/ahci: Clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 23/32] softmmu/vl: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 08/32] hw/virtio/vhost: Silence compiler warnings in vhost code when using -Wshadow,
Markus Armbruster <=
- [PULL 04/32] hw/i386: changes towards enabling -Wshadow=local for x86 machines, Markus Armbruster, 2023/10/06
- [PULL 15/32] qemu-img: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- Re: [PULL 00/32] -Wshadow=local patches patches for 2023-10-06, Stefan Hajnoczi, 2023/10/09