[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5] linux-user/mmap.c: clean up local variable shadowing
From: |
Laurent Vivier |
Subject: |
[PATCH 2/5] linux-user/mmap.c: clean up local variable shadowing |
Date: |
Mon, 25 Sep 2023 17:10:26 +0200 |
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>
---
linux-user/mmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 8eaf57b208b0..8ccaab78590f 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);
--
2.41.0
- [PATCH 0/5] linux-user: clean up local variable shadowing, Laurent Vivier, 2023/09/25
- [PATCH 2/5] linux-user/mmap.c: clean up local variable shadowing,
Laurent Vivier <=
- [PATCH 1/5] linux-user/flatload: clean up local variable shadowing, Laurent Vivier, 2023/09/25
- [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm(), Laurent Vivier, 2023/09/25
- [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls, Laurent Vivier, 2023/09/25
- [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu, Laurent Vivier, 2023/09/25
- Re: [PATCH 0/5] linux-user: clean up local variable shadowing, Markus Armbruster, 2023/09/29