[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/32] linux-user/syscall.c: clean up local variable shadowing in
From: |
Markus Armbruster |
Subject: |
[PULL 31/32] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu |
Date: |
Fri, 6 Oct 2023 13:36:56 +0200 |
From: Laurent Vivier <laurent@vivier.eu>
Fix following warnings:
.../linux-user/syscall.c: In function 'do_syscall1':
.../linux-user/syscall.c:11180:22: warning: declaration of 'cpu' shadows a
previous local [-Wshadow=local]
11180 | unsigned cpu, node;
| ^~~
.../linux-user/syscall.c:8963:15: note: shadowed declaration is here
8963 | CPUState *cpu = env_cpu(cpu_env);
| ^~~
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20230925151029.461358-5-laurent@vivier.eu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
linux-user/syscall.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0f1ecc1e0b..97a5e9ddf2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11177,14 +11177,14 @@ static abi_long do_syscall1(CPUArchState *cpu_env,
int num, abi_long arg1,
}
case TARGET_NR_getcpu:
{
- unsigned cpu, node;
- ret = get_errno(sys_getcpu(arg1 ? &cpu : NULL,
+ unsigned cpuid, node;
+ ret = get_errno(sys_getcpu(arg1 ? &cpuid : NULL,
arg2 ? &node : NULL,
NULL));
if (is_error(ret)) {
return ret;
}
- if (arg1 && put_user_u32(cpu, arg1)) {
+ if (arg1 && put_user_u32(cpuid, arg1)) {
return -TARGET_EFAULT;
}
if (arg2 && put_user_u32(node, arg2)) {
--
2.41.0
- [PULL 00/32] -Wshadow=local patches patches for 2023-10-06, Markus Armbruster, 2023/10/06
- [PULL 10/32] hw/audio/soundhw: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 27/32] hw/usb: Silence compiler warnings in USB code when compiling with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 26/32] target/ppc: Clean up local variable shadowing in kvm_arch_*_registers(), Markus Armbruster, 2023/10/06
- [PULL 06/32] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 21/32] util/guest-random: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 09/32] dump: Silence compiler warning in dump code when compiling with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 05/32] audio/ossaudio: Fix compiler warning with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 01/32] hw/cxl: Fix local variable shadowing of cap_hdrs, Markus Armbruster, 2023/10/06
- [PULL 07/32] hw/virtio/virtio-pci: Avoid compiler warning with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 31/32] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu,
Markus Armbruster <=
- [PULL 18/32] semihosting: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 13/32] os-posix: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 32/32] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls, Markus Armbruster, 2023/10/06
- [PULL 29/32] linux-user/mmap.c: clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 12/32] net/net: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 14/32] plugins/loader: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 16/32] qemu-io: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 03/32] target/ppc: Rename variables to avoid local variable shadowing in VUPKPX, Markus Armbruster, 2023/10/06
- [PULL 19/32] ui/cocoa: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 22/32] semihosting/arm-compat: Clean up local variable shadowing, Markus Armbruster, 2023/10/06