diff mbox series

[4/8] spapr: Clean up local variable shadowing in spapr_init_cpus()

Message ID 20230918145850.241074-5-clg@kaod.org (mailing list archive)
State New, archived
Headers show
Series ppc: Clean up local variable shadowing | expand

Commit Message

Cédric Le Goater Sept. 18, 2023, 2:58 p.m. UTC
Remove extra 'i' variable to fix this warning :

  ../hw/ppc/spapr.c: In function ‘spapr_init_cpus’:
  ../hw/ppc/spapr.c:2668:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]
   2668 |         int i;
        |             ^
  ../hw/ppc/spapr.c:2645:9: note: shadowed declaration is here
   2645 |     int i;
        |         ^

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/spapr.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Harsh Prateek Bora Sept. 19, 2023, 7:30 a.m. UTC | #1
On 9/18/23 20:28, Cédric Le Goater wrote:
> Remove extra 'i' variable to fix this warning :
> 
>    ../hw/ppc/spapr.c: In function ‘spapr_init_cpus’:
>    ../hw/ppc/spapr.c:2668:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local]
>     2668 |         int i;
>          |             ^
>    ../hw/ppc/spapr.c:2645:9: note: shadowed declaration is here
>     2645 |     int i;
>          |         ^
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>

> ---
>   hw/ppc/spapr.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index d89f0fd496b6..41ce7de77c14 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2665,8 +2665,6 @@ static void spapr_init_cpus(SpaprMachineState *spapr)
>       }
>   
>       if (smc->pre_2_10_has_unused_icps) {
> -        int i;
> -
>           for (i = 0; i < spapr_max_server_number(spapr); i++) {
>               /* Dummy entries get deregistered when real ICPState objects
>                * are registered during CPU core hotplug.
diff mbox series

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d89f0fd496b6..41ce7de77c14 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2665,8 +2665,6 @@  static void spapr_init_cpus(SpaprMachineState *spapr)
     }
 
     if (smc->pre_2_10_has_unused_icps) {
-        int i;
-
         for (i = 0; i < spapr_max_server_number(spapr); i++) {
             /* Dummy entries get deregistered when real ICPState objects
              * are registered during CPU core hotplug.