From patchwork Fri Dec 22 01:23:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82725 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 36AE2384DEE6 for ; Fri, 22 Dec 2023 01:25:08 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 22FCD3857739 for ; Fri, 22 Dec 2023 01:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 22FCD3857739 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 22FCD3857739 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208264; cv=none; b=nFVYxUp7zMBbjs5UCztJR1rjq86EK3TmkbKglqeo5FC3J+uQqJSCQHZQ5Xs0j8swEgkzimm4Expb8oObnLZc0YmjNpxX6cAImJaRoPcQTYJfp7kXDTSnCTk6c0THnS7XgzEKxpVUNlREgsllYLhhZQVNN7KJF7kiKbig1Abz0K0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208264; c=relaxed/simple; bh=VdylB8SsIhfYQJ+w5qCL+06gkcqMVUp2ni7wjG5qS+0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ccOqsFiqSk7tgJhJFanHvXk6pKcR9D0avXJGxaCO1ADD2vpaN75oo6Z5E570Zt09uTC4RzXqmOsIMar9S8ifjBVR85XVcqqBgQbICpYxqQIDtHz7/ms5pEw93WC1Z2qvU894MFetnR7K0DjcYk8zvteFJ0qHppo0y0vLZ9/QL7s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id C595A342FF8; Fri, 22 Dec 2023 01:24:22 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 13/15] sim: riscv: fix -Wshadow=local warnings Date: Thu, 21 Dec 2023 20:23:53 -0500 Message-ID: <20231222012355.7504-13-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222012355.7504-1-vapier@gentoo.org> References: <20231222012355.7504-1-vapier@gentoo.org> 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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 Inline the one usage of sd in these macros to avoid possible shadowing. --- sim/riscv/sim-main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c index 4d2053453950..b04d12c0de1c 100644 --- a/sim/riscv/sim-main.c +++ b/sim/riscv/sim-main.c @@ -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)