[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/56] hw/nios2: Clean up local variable shadowing
From: |
Markus Armbruster |
Subject: |
[PULL 19/56] hw/nios2: Clean up local variable shadowing |
Date: |
Fri, 29 Sep 2023 10:50:16 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Fix:
hw/nios2/10m50_devboard.c: In function ‘nios2_10m50_ghrd_init’:
hw/nios2/10m50_devboard.c:101:22: warning: declaration of ‘dev’ shadows a
previous local [-Wshadow=compatible-local]
101 | DeviceState *dev = qdev_new(TYPE_NIOS2_VIC);
| ^~~
hw/nios2/10m50_devboard.c:60:18: note: shadowed declaration is here
60 | DeviceState *dev;
| ^~~
hw/nios2/10m50_devboard.c:110:18: warning: declaration of ‘i’ shadows a
previous local [-Wshadow=compatible-local]
110 | for (int i = 0; i < 32; i++) {
| ^
hw/nios2/10m50_devboard.c:67:9: note: shadowed declaration is here
67 | int i;
| ^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904161235.84651-15-philmd@linaro.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/nios2/10m50_devboard.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c
index 91383fb097..952a0dc33e 100644
--- a/hw/nios2/10m50_devboard.c
+++ b/hw/nios2/10m50_devboard.c
@@ -98,7 +98,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine)
qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal);
if (nms->vic) {
- DeviceState *dev = qdev_new(TYPE_NIOS2_VIC);
+ dev = qdev_new(TYPE_NIOS2_VIC);
MemoryRegion *dev_mr;
qemu_irq cpu_irq;
@@ -107,7 +107,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine)
cpu_irq = qdev_get_gpio_in_named(DEVICE(cpu), "EIC", 0);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irq);
- for (int i = 0; i < 32; i++) {
+ for (i = 0; i < 32; i++) {
irq[i] = qdev_get_gpio_in(dev, i);
}
--
2.41.0
- [PULL 00/56] -Wshadow=local patches patches for 2023-09-29, Markus Armbruster, 2023/09/29
- [PULL 01/56] migration/rdma: Fix save_page method to fail on polling error, Markus Armbruster, 2023/09/29
- [PULL 08/56] tcg: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 07/56] qobject atomics osdep: Make a few macros more hygienic, Markus Armbruster, 2023/09/29
- [PULL 03/56] ui: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 28/56] hw/intc/openpic: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 30/56] pnv/psi: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 18/56] hw/microblaze: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 19/56] hw/nios2: Clean up local variable shadowing,
Markus Armbruster <=
- [PULL 14/56] hw/arm/armv7m: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 06/56] block: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 22/56] util/vhost-user-server: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 31/56] spapr: Clean up local variable shadowing in spapr_dt_cpus(), Markus Armbruster, 2023/09/29
- [PULL 45/56] aspeed/i3c: Rename variable shadowing a local, Markus Armbruster, 2023/09/29
- [PULL 05/56] block/vdi: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 11/56] target/mips: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 15/56] hw/arm/virt: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 09/56] target/arm/tcg: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 04/56] block/dirty-bitmap: Clean up local variable shadowing, Markus Armbruster, 2023/09/29