aboutsummaryrefslogtreecommitdiff
path: root/hw/riscv
diff options
context:
space:
mode:
authorAlistair Francis <alistair23@gmail.com>2023-09-25 14:30:20 +1000
committerMarkus Armbruster <armbru@redhat.com>2023-09-29 10:07:20 +0200
commit010f5557ab1d5d14c3ffc023387289c68b889cc9 (patch)
tree518b0277de39fe4dd364a0a82b7b0688a5855349 /hw/riscv
parente161785c05c8a96962a0ea87a3abefe158d8b035 (diff)
downloadqemu-010f5557ab1d5d14c3ffc023387289c68b889cc9.zip
qemu-010f5557ab1d5d14c3ffc023387289c68b889cc9.tar.gz
qemu-010f5557ab1d5d14c3ffc023387289c68b889cc9.tar.bz2
hw/riscv: opentitan: Fixup local variables shadowing
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags='-Wshadow=local -Wno-error=shadow=local -Wno-error=shadow=compatible-local' To configure Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230925043023.71448-2-alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/riscv')
-rw-r--r--hw/riscv/opentitan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/riscv/opentitan.c b/hw/riscv/opentitan.c
index 6a2fcc4..436503f 100644
--- a/hw/riscv/opentitan.c
+++ b/hw/riscv/opentitan.c
@@ -227,7 +227,7 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
IRQ_M_TIMER));
/* SPI-Hosts */
- for (int i = 0; i < OPENTITAN_NUM_SPI_HOSTS; ++i) {
+ for (i = 0; i < OPENTITAN_NUM_SPI_HOSTS; ++i) {
dev = DEVICE(&(s->spi_host[i]));
if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi_host[i]), errp)) {
return;