qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] linux-user: clean up local variable shadowing
@ 2023-09-25 15:10 Laurent Vivier
  2023-09-25 15:10 ` [PATCH 1/5] linux-user/flatload: " Laurent Vivier
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Laurent Vivier @ 2023-09-25 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Markus Armbruster



Laurent Vivier (5):
  linux-user/flatload: clean up local variable shadowing
  linux-user/mmap.c:  clean up local variable shadowing
  linux-user/syscall.c: clean up local variable shadowing in
    do_ioctl_dm()
  linux-user/syscall.c: clean up local variable shadowing in
    TARGET_NR_getcpu
  linux-user/syscall.c: clean up local variable shadowing in xattr
    syscalls

 linux-user/flatload.c |  8 ++++----
 linux-user/mmap.c     |  6 +++---
 linux-user/syscall.c  | 36 ++++++++++++++++++------------------
 3 files changed, 25 insertions(+), 25 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] linux-user/flatload: clean up local variable shadowing
  2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
@ 2023-09-25 15:10 ` Laurent Vivier
  2023-10-06  9:59   ` Thomas Huth
  2023-09-25 15:10 ` [PATCH 2/5] linux-user/mmap.c: " Laurent Vivier
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2023-09-25 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Markus Armbruster

Fix following warnings:

.../linux-user/flatload.c: In function 'load_flt_binary':
.../linux-user/flatload.c:758:23: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
  758 |             abi_ulong p;
      |                       ^
../../../Projects/qemu/linux-user/flatload.c:722:15: note: shadowed declaration is here
  722 |     abi_ulong p;
      |               ^

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/flatload.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/linux-user/flatload.c b/linux-user/flatload.c
index 4331a11bf010..fdcc4610fa30 100644
--- a/linux-user/flatload.c
+++ b/linux-user/flatload.c
@@ -755,15 +755,15 @@ int load_flt_binary(struct linux_binprm *bprm, struct image_info *info)
     /* Update data segment pointers for all libraries */
     for (i=0; i<MAX_SHARED_LIBS; i++) {
         if (libinfo[i].loaded) {
-            abi_ulong p;
-            p = libinfo[i].start_data;
+            abi_ulong seg;
+            seg = libinfo[i].start_data;
             for (j=0; j<MAX_SHARED_LIBS; j++) {
-                p -= 4;
+                seg -= 4;
                 /* FIXME - handle put_user() failures */
                 if (put_user_ual(libinfo[j].loaded
                                  ? libinfo[j].start_data
                                  : UNLOADED_LIB,
-                                 p))
+                                 seg))
                     return -EFAULT;
             }
         }
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] linux-user/mmap.c:  clean up local variable shadowing
  2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
  2023-09-25 15:10 ` [PATCH 1/5] linux-user/flatload: " Laurent Vivier
@ 2023-09-25 15:10 ` Laurent Vivier
  2023-10-06 10:01   ` Thomas Huth
  2023-09-25 15:10 ` [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() Laurent Vivier
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2023-09-25 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Markus Armbruster

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



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm()
  2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
  2023-09-25 15:10 ` [PATCH 1/5] linux-user/flatload: " Laurent Vivier
  2023-09-25 15:10 ` [PATCH 2/5] linux-user/mmap.c: " Laurent Vivier
@ 2023-09-25 15:10 ` Laurent Vivier
  2023-10-06 11:05   ` Thomas Huth
  2023-09-25 15:10 ` [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu Laurent Vivier
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2023-09-25 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Markus Armbruster

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>
---
 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 3521a2d70b00..c81e8d344486 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



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu
  2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
                   ` (2 preceding siblings ...)
  2023-09-25 15:10 ` [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() Laurent Vivier
@ 2023-09-25 15:10 ` Laurent Vivier
  2023-10-06 11:07   ` Thomas Huth
  2023-09-25 15:10 ` [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls Laurent Vivier
  2023-09-29  7:03 ` [PATCH 0/5] linux-user: clean up local variable shadowing Markus Armbruster
  5 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2023-09-25 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Markus Armbruster

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>
---
 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 c81e8d344486..6139c00ddceb 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



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls
  2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
                   ` (3 preceding siblings ...)
  2023-09-25 15:10 ` [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu Laurent Vivier
@ 2023-09-25 15:10 ` Laurent Vivier
  2023-10-06 11:09   ` Thomas Huth
  2023-09-29  7:03 ` [PATCH 0/5] linux-user: clean up local variable shadowing Markus Armbruster
  5 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2023-09-25 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Markus Armbruster

p is a generic variable in syscall() and can be used by any syscall
case, so this patch removes the useless local variable declaration for
the following syscalls: TARGET_NR_llistxattr, TARGET_NR_listxattr,
TARGET_NR_setxattr, TARGET_NR_lsetxattr, TARGET_NR_getxattr,
TARGET_NR_lgetxattr, TARGET_NR_removexattr, TARGET_NR_lremovexattr.

Fix following warnings:

.../linux-user/syscall.c:12342:15: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
12342 |         void *p, *b = 0;
      |               ^
.../linux-user/syscall.c:8975:11: note: shadowed declaration is here
 8975 |     void *p;
      |           ^
.../linux-user/syscall.c:12379:19: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
12379 |             void *p, *n, *v = 0;
      |                   ^
.../linux-user/syscall.c:8975:11: note: shadowed declaration is here
 8975 |     void *p;
      |           ^
.../linux-user/syscall.c:12424:19: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
12424 |             void *p, *n, *v = 0;
      |                   ^
.../linux-user/syscall.c:8975:11: note: shadowed declaration is here
 8975 |     void *p;
      |           ^
.../linux-user/syscall.c:12469:19: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
12469 |             void *p, *n;
      |                   ^
.../linux-user/syscall.c:8975:11: note: shadowed declaration is here
 8975 |     void *p;
      |           ^

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6139c00ddceb..fe228f7db3a7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -12339,7 +12339,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
     case TARGET_NR_listxattr:
     case TARGET_NR_llistxattr:
     {
-        void *p, *b = 0;
+        void *b = 0;
         if (arg2) {
             b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
             if (!b) {
@@ -12376,7 +12376,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
     case TARGET_NR_setxattr:
     case TARGET_NR_lsetxattr:
         {
-            void *p, *n, *v = 0;
+            void *n, *v = 0;
             if (arg3) {
                 v = lock_user(VERIFY_READ, arg3, arg4, 1);
                 if (!v) {
@@ -12421,7 +12421,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
     case TARGET_NR_getxattr:
     case TARGET_NR_lgetxattr:
         {
-            void *p, *n, *v = 0;
+            void *n, *v = 0;
             if (arg3) {
                 v = lock_user(VERIFY_WRITE, arg3, arg4, 0);
                 if (!v) {
@@ -12466,7 +12466,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
     case TARGET_NR_removexattr:
     case TARGET_NR_lremovexattr:
         {
-            void *p, *n;
+            void *n;
             p = lock_user_string(arg1);
             n = lock_user_string(arg2);
             if (p && n) {
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] linux-user: clean up local variable shadowing
  2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
                   ` (4 preceding siblings ...)
  2023-09-25 15:10 ` [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls Laurent Vivier
@ 2023-09-29  7:03 ` Markus Armbruster
  5 siblings, 0 replies; 12+ messages in thread
From: Markus Armbruster @ 2023-09-29  7:03 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: qemu-devel, Philippe Mathieu-Daudé, Richard Henderson,
	Helge Deller

Review would be nice; cc'ing a few people who have left their mark in
git.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] linux-user/flatload: clean up local variable shadowing
  2023-09-25 15:10 ` [PATCH 1/5] linux-user/flatload: " Laurent Vivier
@ 2023-10-06  9:59   ` Thomas Huth
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2023-10-06  9:59 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel; +Cc: Markus Armbruster

On 25/09/2023 17.10, Laurent Vivier wrote:
> Fix following warnings:
> 
> .../linux-user/flatload.c: In function 'load_flt_binary':
> .../linux-user/flatload.c:758:23: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
>    758 |             abi_ulong p;
>        |                       ^
> ../../../Projects/qemu/linux-user/flatload.c:722:15: note: shadowed declaration is here
>    722 |     abi_ulong p;
>        |               ^
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>   linux-user/flatload.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] linux-user/mmap.c: clean up local variable shadowing
  2023-09-25 15:10 ` [PATCH 2/5] linux-user/mmap.c: " Laurent Vivier
@ 2023-10-06 10:01   ` Thomas Huth
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2023-10-06 10:01 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel; +Cc: Markus Armbruster

On 25/09/2023 17.10, Laurent Vivier wrote:
> 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(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm()
  2023-09-25 15:10 ` [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() Laurent Vivier
@ 2023-10-06 11:05   ` Thomas Huth
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2023-10-06 11:05 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel; +Cc: Markus Armbruster

On 25/09/2023 17.10, Laurent Vivier wrote:
> 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>
> ---
>   linux-user/syscall.c | 22 +++++++++++-----------
>   1 file changed, 11 insertions(+), 11 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu
  2023-09-25 15:10 ` [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu Laurent Vivier
@ 2023-10-06 11:07   ` Thomas Huth
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2023-10-06 11:07 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel; +Cc: Markus Armbruster

On 25/09/2023 17.10, Laurent Vivier wrote:
> 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>
> ---
>   linux-user/syscall.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)


Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls
  2023-09-25 15:10 ` [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls Laurent Vivier
@ 2023-10-06 11:09   ` Thomas Huth
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2023-10-06 11:09 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel; +Cc: Markus Armbruster

On 25/09/2023 17.10, Laurent Vivier wrote:
> p is a generic variable in syscall() and can be used by any syscall
> case, so this patch removes the useless local variable declaration for
> the following syscalls: TARGET_NR_llistxattr, TARGET_NR_listxattr,
> TARGET_NR_setxattr, TARGET_NR_lsetxattr, TARGET_NR_getxattr,
> TARGET_NR_lgetxattr, TARGET_NR_removexattr, TARGET_NR_lremovexattr.
> 
> Fix following warnings:
> 
> .../linux-user/syscall.c:12342:15: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
> 12342 |         void *p, *b = 0;
>        |               ^
> .../linux-user/syscall.c:8975:11: note: shadowed declaration is here
>   8975 |     void *p;
>        |           ^
> .../linux-user/syscall.c:12379:19: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
> 12379 |             void *p, *n, *v = 0;
>        |                   ^
> .../linux-user/syscall.c:8975:11: note: shadowed declaration is here
>   8975 |     void *p;
>        |           ^
> .../linux-user/syscall.c:12424:19: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
> 12424 |             void *p, *n, *v = 0;
>        |                   ^
> .../linux-user/syscall.c:8975:11: note: shadowed declaration is here
>   8975 |     void *p;
>        |           ^
> .../linux-user/syscall.c:12469:19: warning: declaration of 'p' shadows a previous local [-Wshadow=compatible-local]
> 12469 |             void *p, *n;
>        |                   ^
> .../linux-user/syscall.c:8975:11: note: shadowed declaration is here
>   8975 |     void *p;
>        |           ^
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>   linux-user/syscall.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-06 11:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 15:10 [PATCH 0/5] linux-user: clean up local variable shadowing Laurent Vivier
2023-09-25 15:10 ` [PATCH 1/5] linux-user/flatload: " Laurent Vivier
2023-10-06  9:59   ` Thomas Huth
2023-09-25 15:10 ` [PATCH 2/5] linux-user/mmap.c: " Laurent Vivier
2023-10-06 10:01   ` Thomas Huth
2023-09-25 15:10 ` [PATCH 3/5] linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() Laurent Vivier
2023-10-06 11:05   ` Thomas Huth
2023-09-25 15:10 ` [PATCH 4/5] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu Laurent Vivier
2023-10-06 11:07   ` Thomas Huth
2023-09-25 15:10 ` [PATCH 5/5] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls Laurent Vivier
2023-10-06 11:09   ` Thomas Huth
2023-09-29  7:03 ` [PATCH 0/5] linux-user: clean up local variable shadowing Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).