Skip to contentSkip to conversation

target/ppc: Clean up local variable shadowing in kvm_arch_*_registers()

PATCH Applied Cédric Le Goater 3 participants 3 messages Oct 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: Clean up local variable shadowing in kvm_arch_*_registers()

Remove extra 'i' variable to fix this warning :

../target/ppc/kvm.c: In function ‘kvm_arch_put_registers’:
../target/ppc/kvm.c:963:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]

    963 |         int i;
        |             ^
  ../target/ppc/kvm.c:906:9: note: shadowed declaration is here
    906 |     int i;
        |         ^

../target/ppc/kvm.c: In function ‘kvm_arch_get_registers’:
../target/ppc/kvm.c:1265:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]
1265 | int i;
| ^
../target/ppc/kvm.c:1212:9: note: shadowed declaration is here
1212 | int i, ret;
| ^

---
 target/ppc/kvm.c | 4 ----
 1 file changed, 4 deletions(-)
target/ppc/kvm.c +0 -4
index 51112bd3670d..d0e2dcdc7734 100644
@@ -960,8 +960,6 @@ int kvm_arch_put_registers(CPUState *cs, int level)
     }
 
     if (cap_one_reg) {
-        int i;
-
         /*
          * We deliberately ignore errors here, for kernels which have
          * the ONE_REG calls, but don't support the specific
@@ -1262,8 +1260,6 @@ int kvm_arch_get_registers(CPUState *cs)
     }
 
     if (cap_one_reg) {
-        int i;
-
         /*
          * We deliberately ignore errors here, for kernels which have
          * the ONE_REG calls, but don't support the specific
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Cédric Le Goater

Remove extra 'i' variable to fix this warning :

../target/ppc/kvm.c: In function ‘kvm_arch_put_registers’:
../target/ppc/kvm.c:963:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]

     963 |         int i;
         |             ^
   ../target/ppc/kvm.c:906:9: note: shadowed declaration is here
     906 |     int i;
         |         ^
   ../target/ppc/kvm.c: In function ‘kvm_arch_get_registers’:
   ../target/ppc/kvm.c:1265:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]
    1265 |         int i;
         |             ^
   ../target/ppc/kvm.c:1212:9: note: shadowed declaration is here
    1212 |     int i, ret;
         |         ^
Quoted 4 lines
---
  target/ppc/kvm.c | 4 ----
  1 file changed, 4 deletions(-)
#2 lore raw
In reply to Cédric Le Goater
Quoted 17 lines · Cédric Le Goater

Remove extra 'i' variable to fix this warning :

../target/ppc/kvm.c: In function ‘kvm_arch_put_registers’:
../target/ppc/kvm.c:963:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]

    963 |         int i;
        |             ^
  ../target/ppc/kvm.c:906:9: note: shadowed declaration is here
    906 |     int i;
        |         ^

../target/ppc/kvm.c: In function ‘kvm_arch_get_registers’:
../target/ppc/kvm.c:1265:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]
1265 | int i;
| ^
../target/ppc/kvm.c:1212:9: note: shadowed declaration is here
1212 | int i, ret;
| ^

Quoted 1 line

Queued, thanks!