[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/32] linux-user/syscall.c: clean up local variable shadowing in
From: |
Markus Armbruster |
Subject: |
[PULL 30/32] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() |
Date: |
Fri, 6 Oct 2023 13:36:55 +0200 |
From: Laurent Vivier <laurent@vivier.eu>
Fix following warnings:
.../linux-user/syscall.c: In function 'do_ioctl_dm':
.../linux-user/syscall.c:5053:23: warning: declaration of 'arg_type' shadows a
previous local [-Wshadow=local]
5053 | const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
| ^~~~~~~~
.../linux-user/syscall.c:4991:20: note: shadowed declaration is here
4991 | const argtype *arg_type = ie->arg_type;
| ^~~~~~~~
...//linux-user/syscall.c:5102:27: warning: declaration of 'arg_type' shadows a
previous local [-Wshadow=local]
5102 | const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_name_list)
};
| ^~~~~~~~
.../linux-user/syscall.c:4991:20: note: shadowed declaration is here
4991 | const argtype *arg_type = ie->arg_type;
| ^~~~~~~~
.../linux-user/syscall.c:5130:27: warning: declaration of 'arg_type' shadows a
previous local [-Wshadow=local]
5130 | const argtype arg_type[] = {
MK_STRUCT(STRUCT_dm_target_spec) };
| ^~~~~~~~
.../linux-user/syscall.c:4991:20: note: shadowed declaration is here
4991 | const argtype *arg_type = ie->arg_type;
| ^~~~~~~~
.../linux-user/syscall.c:5170:27: warning: declaration of 'arg_type' shadows a
previous local [-Wshadow=local]
5170 | const argtype arg_type[] = {
MK_STRUCT(STRUCT_dm_target_versions) };
| ^~~~~~~~
.../linux-user/syscall.c:4991:20: note: shadowed declaration is here
4991 | const argtype *arg_type = ie->arg_type;
| ^~~~~~~~
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20230925151029.461358-4-laurent@vivier.eu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
linux-user/syscall.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c6ffadd082..0f1ecc1e0b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5050,8 +5050,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
{
void *gspec = argptr;
void *cur_data = host_data;
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
- int spec_size = thunk_type_size(arg_type, 0);
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
+ int spec_size = thunk_type_size(dm_arg_type, 0);
int i;
for (i = 0; i < host_dm->target_count; i++) {
@@ -5059,7 +5059,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
uint32_t next;
int slen;
- thunk_convert(spec, gspec, arg_type, THUNK_HOST);
+ thunk_convert(spec, gspec, dm_arg_type, THUNK_HOST);
slen = strlen((char*)gspec + spec_size) + 1;
next = spec->next;
spec->next = sizeof(*spec) + slen;
@@ -5099,7 +5099,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
struct dm_name_list *nl = (void*)host_dm + host_dm->data_start;
uint32_t remaining_data = guest_data_size;
void *cur_data = argptr;
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_name_list) };
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_name_list) };
int nl_size = 12; /* can't use thunk_size due to alignment */
while (1) {
@@ -5111,7 +5111,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
host_dm->flags |= DM_BUFFER_FULL_FLAG;
break;
}
- thunk_convert(cur_data, nl, arg_type, THUNK_TARGET);
+ thunk_convert(cur_data, nl, dm_arg_type, THUNK_TARGET);
strcpy(cur_data + nl_size, nl->name);
cur_data += nl->next;
remaining_data -= nl->next;
@@ -5127,8 +5127,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
{
struct dm_target_spec *spec = (void*)host_dm + host_dm->data_start;
void *cur_data = argptr;
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
- int spec_size = thunk_type_size(arg_type, 0);
+ const argtype dm_arg_type[] = { MK_STRUCT(STRUCT_dm_target_spec) };
+ int spec_size = thunk_type_size(dm_arg_type, 0);
int i;
for (i = 0; i < host_dm->target_count; i++) {
@@ -5139,7 +5139,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
host_dm->flags |= DM_BUFFER_FULL_FLAG;
break;
}
- thunk_convert(cur_data, spec, arg_type, THUNK_TARGET);
+ thunk_convert(cur_data, spec, dm_arg_type, THUNK_TARGET);
strcpy(cur_data + spec_size, (char*)&spec[1]);
cur_data = argptr + spec->next;
spec = (void*)host_dm + host_dm->data_start + next;
@@ -5167,8 +5167,8 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
struct dm_target_versions *vers = (void*)host_dm +
host_dm->data_start;
uint32_t remaining_data = guest_data_size;
void *cur_data = argptr;
- const argtype arg_type[] = { MK_STRUCT(STRUCT_dm_target_versions)
};
- int vers_size = thunk_type_size(arg_type, 0);
+ const argtype dm_arg_type[] = {
MK_STRUCT(STRUCT_dm_target_versions) };
+ int vers_size = thunk_type_size(dm_arg_type, 0);
while (1) {
uint32_t next = vers->next;
@@ -5179,7 +5179,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t
*buf_temp, int fd,
host_dm->flags |= DM_BUFFER_FULL_FLAG;
break;
}
- thunk_convert(cur_data, vers, arg_type, THUNK_TARGET);
+ thunk_convert(cur_data, vers, dm_arg_type, THUNK_TARGET);
strcpy(cur_data + vers_size, vers->name);
cur_data += vers->next;
remaining_data -= vers->next;
--
2.41.0
- [PULL 14/32] plugins/loader: Clean up global variable shadowing, (continued)
- [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
- [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 <=
- [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, 2023/10/06
- [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