From 46ebce9b9c70c85caa9e4cfb5c19340ccfec38fc Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 25 Dec 2022 00:31:19 -0500 Subject: [PATCH] sim: or1k: fix iterator typo when setting up cpus This code loops over available cpus with "c", but then looks up the cpu with "i". Fix the typo so the code works correctly with smp. --- sim/or1k/sim-if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/or1k/sim-if.c b/sim/or1k/sim-if.c index d698d7035bf..799812bb741 100644 --- a/sim/or1k/sim-if.c +++ b/sim/or1k/sim-if.c @@ -244,7 +244,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd, } /* Do some final OpenRISC sim specific initializations. */ - for (c = 0; c < MAX_NR_PROCESSORS; ++c) + for (i = 0; i < MAX_NR_PROCESSORS; ++i) { SIM_CPU *cpu = STATE_CPU (sd, i); /* Only needed for profiling, but the structure member is small. */ -- 2.30.2