aboutsummaryrefslogtreecommitdiff
path: root/linux-user/mmap.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2023-09-25 17:10:26 +0200
committerMarkus Armbruster <armbru@redhat.com>2023-10-06 13:27:48 +0200
commitea80003315dec5ae872ee01b22380a461d14b93e (patch)
tree41b8c0cbb5f42fe73ccc9b4f247dea723fb7e88d /linux-user/mmap.c
parentd5308ea64c1a4608f98b80e83a126515045d0fac (diff)
downloadqemu-ea80003315dec5ae872ee01b22380a461d14b93e.zip
qemu-ea80003315dec5ae872ee01b22380a461d14b93e.tar.gz
qemu-ea80003315dec5ae872ee01b22380a461d14b93e.tar.bz2
linux-user/mmap.c: clean up local variable shadowing
Fix following warnings: .../linux-user/mmap.c: In function 'target_mremap': .../linux-user/mmap.c:913:13: warning: declaration of 'prot' shadows a previous local [-Wshadow=compatible-local] 913 | int prot = 0; | ^~~~ ../../../Projects/qemu/linux-user/mmap.c:871:9: note: shadowed declaration is here 871 | int prot; | ^~~~ Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-ID: <20230925151029.461358-3-laurent@vivier.eu> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'linux-user/mmap.c')
-rw-r--r--linux-user/mmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 8eaf57b..8ccaab7 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -910,16 +910,16 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
}
}
} else {
- int prot = 0;
+ int page_flags = 0;
if (reserved_va && old_size < new_size) {
abi_ulong addr;
for (addr = old_addr + old_size;
addr < old_addr + new_size;
addr++) {
- prot |= page_get_flags(addr);
+ page_flags |= page_get_flags(addr);
}
}
- if (prot == 0) {
+ if (page_flags == 0) {
host_addr = mremap(g2h_untagged(old_addr),
old_size, new_size, flags);