diff options
author | Markus Armbruster <armbru@redhat.com> | 2023-09-21 14:13:07 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2023-09-29 08:13:57 +0200 |
commit | 7f3de3f02f0bd0eaa3ba4506f9a60c1c35865e93 (patch) | |
tree | 86a00b7085adafe28acc08f9de52de96c93711c5 /migration/ram.c | |
parent | bbde656263d80429b51017b077d9b4064ba13b01 (diff) | |
download | qemu-7f3de3f02f0bd0eaa3ba4506f9a60c1c35865e93.zip qemu-7f3de3f02f0bd0eaa3ba4506f9a60c1c35865e93.tar.gz qemu-7f3de3f02f0bd0eaa3ba4506f9a60c1c35865e93.tar.bz2 |
migration: Clean up local variable shadowing
Local variables shadowing other local variables or parameters make the
code needlessly hard to understand. Tracked down with -Wshadow=local.
Clean up: delete inner declarations when they are actually redundant,
else rename variables.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Message-ID: <20230921121312.1301864-3-armbru@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r-- | migration/ram.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/migration/ram.c b/migration/ram.c index 9040d66..0c202f8 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3517,8 +3517,6 @@ int colo_init_ram_cache(void) * we use the same name 'ram_bitmap' as for migration. */ if (ram_bytes_total()) { - RAMBlock *block; - RAMBLOCK_FOREACH_NOT_IGNORED(block) { unsigned long pages = block->max_length >> TARGET_PAGE_BITS; block->bmap = bitmap_new(pages); @@ -3998,12 +3996,12 @@ static int ram_load_precopy(QEMUFile *f) } } if (migrate_ignore_shared()) { - hwaddr addr = qemu_get_be64(f); + hwaddr addr2 = qemu_get_be64(f); if (migrate_ram_is_ignored(block) && - block->mr->addr != addr) { + block->mr->addr != addr2) { error_report("Mismatched GPAs for block %s " "%" PRId64 "!= %" PRId64, - id, (uint64_t)addr, + id, (uint64_t)addr2, (uint64_t)block->mr->addr); ret = -EINVAL; } |