mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target/riscv: cpu: 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-3-alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
committed by
Markus Armbruster
parent
010f5557ab
commit
29332994d8
+2
-2
@@ -704,7 +704,7 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
CSR_MPMMASK,
|
||||
};
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(dump_csrs); ++i) {
|
||||
for (i = 0; i < ARRAY_SIZE(dump_csrs); ++i) {
|
||||
int csrno = dump_csrs[i];
|
||||
target_ulong val = 0;
|
||||
RISCVException res = riscv_csrrw_debug(env, csrno, &val, 0, 0);
|
||||
@@ -747,7 +747,7 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
CSR_VTYPE,
|
||||
CSR_VLENB,
|
||||
};
|
||||
for (int i = 0; i < ARRAY_SIZE(dump_rvv_csrs); ++i) {
|
||||
for (i = 0; i < ARRAY_SIZE(dump_rvv_csrs); ++i) {
|
||||
int csrno = dump_rvv_csrs[i];
|
||||
target_ulong val = 0;
|
||||
RISCVException res = riscv_csrrw_debug(env, csrno, &val, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user