From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 13C2C3850F05 for ; Sun, 25 Dec 2022 07:14:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13C2C3850F05 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 7E475340F8F; Sun, 25 Dec 2022 07:14:44 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 3/9] sim: or1k: fix iterator typo when setting up cpus Date: Sun, 25 Dec 2022 02:14:28 -0500 Message-Id: <20221225071434.30014-3-vapier@gentoo.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225071434.30014-1-vapier@gentoo.org> References: <20221225071434.30014-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 d698d7035bf7..799812bb741e 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.39.0