qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] target/loongarch: Clean up local variable shadowing
@ 2023-09-26  7:12 Song Gao
  2023-10-04 10:34 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: Song Gao @ 2023-09-26  7:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, richard.henderson, philmd, yangxiaojuan, maobibo

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));
     }
 
-- 
2.39.1



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

* Re: [PATCH 1/1] target/loongarch: Clean up local variable shadowing
  2023-09-26  7:12 [PATCH 1/1] target/loongarch: Clean up local variable shadowing Song Gao
@ 2023-10-04 10:34 ` Markus Armbruster
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2023-10-04 10:34 UTC (permalink / raw)
  To: Song Gao
  Cc: qemu-devel, armbru, richard.henderson, philmd, yangxiaojuan,
	maobibo

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!



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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26  7:12 [PATCH 1/1] target/loongarch: Clean up local variable shadowing Song Gao
2023-10-04 10:34 ` 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).