qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] target/loongarch: Clean up local variable shadowing


From: Markus Armbruster
Subject: Re: [PATCH 1/1] target/loongarch: Clean up local variable shadowing
Date: Wed, 04 Oct 2023 12:34:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Song Gao <gaosong@loongson.cn> writes:

> Fix:
>
>   [1839/2601] Compiling C object 
> libqemu-loongarch64-softmmu.fa.p/hw_loongarch_virt.c.o
>   ../hw/loongarch/virt.c: In function 'loongarch_irq_init':
>   ../hw/loongarch/virt.c:665:14: warning: declaration of 'i' shadows a 
> previous local [-Wshadow=compatible-local]
>        for (int i = 0; i < num; i++) {
>                 ^
>   ../hw/loongarch/virt.c:582:19: note: shadowed declaration is here
>        int cpu, pin, i, start, num;
>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
>  hw/loongarch/virt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
> index 2629128aed..b0a004f860 100644
> --- a/hw/loongarch/virt.c
> +++ b/hw/loongarch/virt.c
> @@ -662,7 +662,7 @@ static void loongarch_irq_init(LoongArchMachineState 
> *lams)
>                              sysbus_mmio_get_region(d, 2));
>  
>      /* Connect pch_pic irqs to extioi */
> -    for (int i = 0; i < num; i++) {
> +    for (i = 0; i < num; i++) {
>          qdev_connect_gpio_out(DEVICE(d), i, qdev_get_gpio_in(extioi, i));
>      }

Reviewed-by: Markus Armbruster <armbru@redhat.com>

and queued.  Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]