From patchwork Tue Dec 19 10:51:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82447 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9772E3861870 for ; Tue, 19 Dec 2023 10:52:15 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id D08AF3858D38 for ; Tue, 19 Dec 2023 10:52:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D08AF3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D08AF3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702983122; cv=none; b=W4v2Ypma3cRepg6uIjWiWVtinVgnRDvcZVusZDxlXjExdNuPcO54+AKRQeK1qK8JrvJzZ1X2jyEjDbsQFeyjSieQKeuN2S5frk4S/FkuqsAmGNoW4DFXu+jgxEShqOcHF7cVCfcm0AVGvgMYIDyDdN4i1eF2e8tNuoBpBRAORTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702983122; c=relaxed/simple; bh=wF/+NUgK4XPt+XlO2T78DQaurGoiD2TYsE9BsENzVus=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Al0sYdMjqVq6AIrqDkVjJq8o551N0NKubkQvdIYn+F/p/mXVJ/coHsol5IATdM/hXebvsnufumXcN/UKI6zyki4mJebiwh/ekGRip9bWGMDFTY1JcNGmbWFqSh5UMV7lB1GdxtLy832eXj2ICHP7Pz/dn1UIIGjhT0CSL5VMpww= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 80D0A335DCC; Tue, 19 Dec 2023 10:52:00 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 01/21] sim: common: fix -Wunused-variable warnings Date: Tue, 19 Dec 2023 05:51:35 -0500 Message-ID: <20231219105155.10433-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org --- sim/common/cgen-run.c | 3 +-- sim/common/cgen-scache.c | 12 ++++++++---- sim/common/sim-module.c | 2 -- sim/common/sim-options.c | 1 - sim/common/sim-watch.c | 2 -- sim/common/syscall.c | 4 +--- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/sim/common/cgen-run.c b/sim/common/cgen-run.c index 29578b0c57f2..b0b7cf1ed365 100644 --- a/sim/common/cgen-run.c +++ b/sim/common/cgen-run.c @@ -56,8 +56,7 @@ static void engine_run_n (SIM_DESC, int, int, int, int); static int cgen_get_fast_p (SIM_DESC sd) { - int i, c; - int run_fast_p = 1; + int c; for (c = 0; c < MAX_NR_PROCESSORS; ++c) { diff --git a/sim/common/cgen-scache.c b/sim/common/cgen-scache.c index c6de30e16575..46dada7e2564 100644 --- a/sim/common/cgen-scache.c +++ b/sim/common/cgen-scache.c @@ -276,7 +276,10 @@ scache_flush (SIM_DESC sd) void scache_flush_cpu (SIM_CPU *cpu) { - int i,n; + int i; +#if WITH_SCACHE_PBB + int n; +#endif /* Don't bother if cache not in use. */ if (CPU_SCACHE_SIZE (cpu) == 0) @@ -426,9 +429,6 @@ scache_print_profile (SIM_CPU *cpu, bool verbose) unsigned long hits = CPU_SCACHE_HITS (cpu); unsigned long misses = CPU_SCACHE_MISSES (cpu); char buf[20]; - unsigned long max_val; - unsigned long *lengths; - int i; if (CPU_SCACHE_SIZE (cpu) == 0) return; @@ -460,6 +460,10 @@ scache_print_profile (SIM_CPU *cpu, bool verbose) if (verbose) { + unsigned long max_val; + unsigned long *lengths; + int i; + sim_io_printf (sd, " Insn chain lengths:\n\n"); max_val = 0; lengths = CPU_SCACHE_CHAIN_LENGTHS (cpu); diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c index f03e4b774b75..ac8c9782f440 100644 --- a/sim/common/sim-module.c +++ b/sim/common/sim-module.c @@ -133,8 +133,6 @@ sim_module_install_list (SIM_DESC sd, MODULE_INSTALL_FN * const *modules, SIM_RC sim_module_install (SIM_DESC sd) { - MODULE_INSTALL_FN * const *modp; - SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); SIM_ASSERT (STATE_MODULES (sd) == NULL); diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index a6cd0037d2aa..9f238339fb8f 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -1078,7 +1078,6 @@ complete_option_list (char **ret, size_t *cnt, const struct option_list *ol, const char *text, const char *word) { const OPTION *opt = NULL; - int argi; size_t len = strlen (word); for ( ; ol != NULL; ol = ol->next) diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c index 6f9a53ac3b19..3366257d3c1a 100644 --- a/sim/common/sim-watch.c +++ b/sim/common/sim-watch.c @@ -169,8 +169,6 @@ static SIM_RC schedule_watchpoint (SIM_DESC sd, sim_watch_point *point) { - sim_watchpoints *watch = STATE_WATCHPOINTS (sd); - switch (point->type) { case pc_watchpoint: diff --git a/sim/common/syscall.c b/sim/common/syscall.c index 96033db84c3b..9d08730fc739 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -213,9 +213,7 @@ cb_syscall (host_callback *cb, CB_SYSCALL *sc) /* Buffer size. */ int bufsize = sc->arg2; int written = 0; - /* Q is the target address of where all the strings go. */ - TADDR q; - int i, argc, envc, len, ret; + int argc, envc, len, ret; char **argv = cb->argv; char **envp = cb->envp;