[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 44/56] aspeed: Clean up local variable shadowing
From: |
Markus Armbruster |
Subject: |
[PULL 44/56] aspeed: Clean up local variable shadowing |
Date: |
Fri, 29 Sep 2023 10:50:41 +0200 |
From: Cédric Le Goater <clg@kaod.org>
Remove superfluous local 'irq' variables and use the one define at the
top of the routine. This fixes warnings in aspeed_soc_ast2600_realize()
such as :
../hw/arm/aspeed_ast2600.c: In function ‘aspeed_soc_ast2600_realize’:
../hw/arm/aspeed_ast2600.c:420:18: warning: declaration of ‘irq’ shadows a
previous local [-Wshadow=compatible-local]
420 | qemu_irq irq = aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 + i);
| ^~~
../hw/arm/aspeed_ast2600.c:312:14: note: shadowed declaration is here
312 | qemu_irq irq;
| ^~~
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-ID: <20230922155924.1172019-3-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/arm/aspeed_ast2600.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index a8b3a8065a..e122e1c32d 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -388,7 +388,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
Error **errp)
aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->timerctrl), 0,
sc->memmap[ASPEED_DEV_TIMER1]);
for (i = 0; i < ASPEED_TIMER_NR_TIMERS; i++) {
- qemu_irq irq = aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 + i);
+ irq = aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 + i);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->timerctrl), i, irq);
}
@@ -413,8 +413,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
Error **errp)
}
aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i2c), 0, sc->memmap[ASPEED_DEV_I2C]);
for (i = 0; i < ASPEED_I2C_GET_CLASS(&s->i2c)->num_busses; i++) {
- qemu_irq irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore),
- sc->irqmap[ASPEED_DEV_I2C] + i);
+ irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore),
+ sc->irqmap[ASPEED_DEV_I2C] + i);
/* The AST2600 I2C controller has one IRQ per bus. */
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq);
}
@@ -611,8 +611,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
Error **errp)
}
aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i3c), 0, sc->memmap[ASPEED_DEV_I3C]);
for (i = 0; i < ASPEED_I3C_NR_DEVICES; i++) {
- qemu_irq irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore),
- sc->irqmap[ASPEED_DEV_I3C] + i);
+ irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore),
+ sc->irqmap[ASPEED_DEV_I3C] + i);
/* The AST2600 I3C controller has one IRQ per bus. */
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i3c.devices[i]), 0, irq);
}
--
2.41.0
- [PULL 21/56] crypto/cipher-gnutls.c: Clean up local variable shadowing, (continued)
- [PULL 21/56] crypto/cipher-gnutls.c: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 29/56] hw/ppc: Clean up local variable shadowing in _FDT helper routine, Markus Armbruster, 2023/09/29
- [PULL 16/56] hw/arm/allwinner: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 20/56] net/eth: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 10/56] target/arm/hvf: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 39/56] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd(), Markus Armbruster, 2023/09/29
- [PULL 33/56] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path(), Markus Armbruster, 2023/09/29
- [PULL 36/56] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Markus Armbruster, 2023/09/29
- [PULL 24/56] sysemu/device_tree: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 27/56] hw/core/machine: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 44/56] aspeed: Clean up local variable shadowing,
Markus Armbruster <=
- [PULL 43/56] aspeed/i2c: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 35/56] spapr/pci: Clean up local variable shadowing in spapr_phb_realize(), Markus Armbruster, 2023/09/29
- [PULL 37/56] test-throttle: don't shadow 'index' variable in do_test_accounting(), Markus Armbruster, 2023/09/29
- [PULL 46/56] aspeed/timer: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 56/56] disas/m68k: clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 55/56] hw/nvme: Clean up local variable shadowing in nvme_ns_init(), Markus Armbruster, 2023/09/29
- [PULL 50/56] qemu-nbd: changes towards enabling -Wshadow=local, Markus Armbruster, 2023/09/29
- [PULL 54/56] softmmu/device_tree: Fixup local variables shadowing, Markus Armbruster, 2023/09/29
- [PULL 51/56] hw/riscv: opentitan: Fixup local variables shadowing, Markus Armbruster, 2023/09/29
- [PULL 40/56] hw/misc/arm_sysctl.c: Avoid shadowing local variable, Markus Armbruster, 2023/09/29