sim: riscv: fix -Wshadow=local warnings
authorMike Frysinger <vapier@gentoo.org>
Fri, 22 Dec 2023 01:13:56 +0000 (20:13 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 23 Dec 2023 04:29:19 +0000 (23:29 -0500)
Inline the one usage of sd in these macros to avoid possible shadowing.

sim/riscv/sim-main.c

index 4d20534..b04d12c 100644 (file)
@@ -48,10 +48,9 @@ static const struct riscv_opcode *riscv_hash[OP_MASK_OP + 1];
   do { \
     if (RISCV_XLEN (cpu) != 32) \
       { \
-       SIM_DESC sd = CPU_STATE (cpu); \
        TRACE_INSN (cpu, "RV32I-only " fmt, ## args); \
-       sim_engine_halt (sd, cpu, NULL, sim_pc_get (cpu), sim_signalled, \
-                        SIM_SIGILL); \
+       sim_engine_halt (CPU_STATE (cpu), cpu, NULL, sim_pc_get (cpu), \
+                        sim_signalled, SIM_SIGILL); \
       } \
   } while (0)
 
@@ -59,10 +58,9 @@ static const struct riscv_opcode *riscv_hash[OP_MASK_OP + 1];
   do { \
     if (RISCV_XLEN (cpu) != 64) \
       { \
-       SIM_DESC sd = CPU_STATE (cpu); \
        TRACE_INSN (cpu, "RV64I-only " fmt, ## args); \
-       sim_engine_halt (sd, cpu, NULL, sim_pc_get (cpu), sim_signalled, \
-                        SIM_SIGILL); \
+       sim_engine_halt (CPU_STATE (cpu), cpu, NULL, sim_pc_get (cpu), \
+                        sim_signalled, SIM_SIGILL); \
       } \
   } while (0)