From patchwork Thu Aug 31 22:55:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 719040 Delivered-To: patch@linaro.org Received: by 2002:adf:e5c2:0:b0:31d:da82:a3b4 with SMTP id a2csp741853wrn; Thu, 31 Aug 2023 15:58:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhEbp2CntH3V5YMu3fpUYmcSjFb7fXy51gjG4J9QrlKlErRgl08NEYd5iFrTJJmgQEpXix X-Received: by 2002:a05:622a:4f:b0:412:2525:11a2 with SMTP id y15-20020a05622a004f00b00412252511a2mr1167995qtw.35.1693522731868; Thu, 31 Aug 2023 15:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693522731; cv=none; d=google.com; s=arc-20160816; b=v5QchS4awCGNSN0BdtL7QUfWbYgff8lz5NkSa3VX7z79MqIJY6wCRn35+J1k8m1T7e 0a6Zu8plkcJAchhHp7HBTiT5nQSpuXIODl/SL9WBa/IFDqvlpzEf9SRakWnbxRvBcp4b jZX6sIGxSZ76Mv5TZAmVhR8ffBzvRrIQ6/zZ12DhHVi4wl7RlB8G2TjSUi9YXrC9yMTW eC9yLHAKOswNOfBvrYTwAkYEGNQf/sgse31E7FHFak2AUsuN0/S7hOilaFp2MiRD3eAM Uxx/N+XbVTsMK8BlRjzHVmCRaEM7PqRcepHIEJ5Yb8E9dR+98gc0borIXuU94jMbCm1+ sbgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kEesyLIbjrA7oeyx/iNQirg7zO4jKel4RvIBPMrDvkc=; fh=CMH4F3RZ59Ef3SLg0ppc7vxpUPvCiZChm09KUhwMALI=; b=Lmx3o+//cKRGAzIu5UwZ87X4QEcw4JnmJohm0oUQ7xOblbsCFJB1uYfm5jDEr+8AB5 1QUaNY7aJKXxWOULEce5aGo7u+W56TYlPC4twSKDSk4rRxYifxnArtkSt1c5iNiBdIGR 1/yy+tWNXxT6qLYW/FwkbCpsSO2ws/Oc1QNCqcc6u3R1XqhZIaBVk8vujcffG6rsMbaF IUfE50CeuTzqpgA0N1y8tZAbDy5Ngf9T32R60SOcqcv79KlboLAbZ07mfV2kKGjRwsUs T4qvHw25JBj6DoUfMnKXLbeI/e3G7WUK3obDTjfLQHo2hdV4DpLhp5Brn1JCrYuGFv/j huJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F4jVEE/E"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n10-20020a05622a11ca00b004084b9eeaf7si1514213qtk.357.2023.08.31.15.58.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2023 15:58:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F4jVEE/E"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbqaV-0003uZ-8l; Thu, 31 Aug 2023 18:56:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbqaS-0003tO-Bu for qemu-devel@nongnu.org; Thu, 31 Aug 2023 18:56:28 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbqaP-0002q9-Bg for qemu-devel@nongnu.org; Thu, 31 Aug 2023 18:56:28 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-99de884ad25so168094966b.3 for ; Thu, 31 Aug 2023 15:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693522584; x=1694127384; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kEesyLIbjrA7oeyx/iNQirg7zO4jKel4RvIBPMrDvkc=; b=F4jVEE/EC9e8pVSN7jp1DFlKqcEYCPgMMV8Kt3Y42JeEYljU7v5fkFy1wY1OVuYPUD YKLN4EOH6ZU4dwVr7wd7qY4HE2FkSJFDnQRx2+rmtiFxKlJME2wen2Y+TujK5dqgizcn 5CwB/dN/lfSgqGIhhLtJurGa4CIwVf3p7tlH+XY1E10DxCl4P4k1yXTdYu2sPqDl4pQm o8lSsoy+wip0ruywOYrEpYLTJoAl2Ydi98FSsp3V9PrkQJtPGhmL2rcTd7nOGzbfVU81 xt21lZT6yPV64kUaU9cRnvfDHz6rd5LoSDnoapxICq3wwXFDcWU0Nwx0X92Pg8yYZUDy /gMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693522584; x=1694127384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kEesyLIbjrA7oeyx/iNQirg7zO4jKel4RvIBPMrDvkc=; b=FNK8wuZ7eknYlVywArFbJCKNHsvL3y7tsow4SDxtQ3rz65bXB6vD/JPVsGjInIjBtF p3LQFrjJ70N0+FcvluFWOyU9ume0B8qgVXlPTk0RwjYuycraQRJwrazywnhlEVqKEN+C xISyv7zEoz9xfqzmuFgag8m26wCJcGJs2bxMml8UxvZPxXv5vVJnGcykaEGUizsCAabW iA66OBtjf3WKCAlGTsOUXz7mvXLHSKzs312hcE49BXYwp4ZCqEjMMRpTDhkwgMHY3To/ iYnlD4icV918XGNbrzA9/TzZgEwX/kGswfASb5i7iWpm+I9190MUwFZnZ7X1EWGYpDEI cLhA== X-Gm-Message-State: AOJu0Yzl4riqE7sEJq9x/BGkMyM3cCw2Cv+Ker622l8ryd1mCj+so1O3 qE43JiWDblrg2+DfgU4YLW5lTcU09oYhFQYkdKU= X-Received: by 2002:a17:906:224b:b0:9a1:bee8:9252 with SMTP id 11-20020a170906224b00b009a1bee89252mr542069ejr.29.1693522583206; Thu, 31 Aug 2023 15:56:23 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.245]) by smtp.gmail.com with ESMTPSA id jw26-20020a17090776ba00b00982a92a849asm1252665ejc.91.2023.08.31.15.56.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Aug 2023 15:56:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Alexander Graf , Peter Maydell Subject: [PATCH 02/11] target/arm: Clean up local variable shadowing Date: Fri, 1 Sep 2023 00:55:57 +0200 Message-ID: <20230831225607.30829-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230831225607.30829-1-philmd@linaro.org> References: <20230831225607.30829-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: target/arm/tcg/translate-m-nocp.c:509:18: error: declaration shadows a local variable [-Werror,-Wshadow] TCGv_i32 tmp = load_cpu_field(v7m.fpdscr[M_REG_NS]); ^ target/arm/tcg/translate-m-nocp.c:433:14: note: previous declaration is here TCGv_i32 tmp; ^ target/arm/tcg/mve_helper.c:2463:17: error: declaration shadows a local variable [-Werror,-Wshadow] int64_t extval = sextract64(src << shift, 0, 48); ^ target/arm/tcg/mve_helper.c:2443:18: note: previous declaration is here int64_t val, extval; ^ target/arm/hvf/hvf.c:1936:13: error: declaration shadows a local variable [-Werror,-Wshadow] int ret = 0; ^ target/arm/hvf/hvf.c:1807:9: note: previous declaration is here int ret; ^ Signed-off-by: Philippe Mathieu-Daudé --- target/arm/hvf/hvf.c | 1 - target/arm/tcg/mve_helper.c | 8 ++++---- target/arm/tcg/translate-m-nocp.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 486f90be1d..20d534faef 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1933,7 +1933,6 @@ int hvf_vcpu_exec(CPUState *cpu) uint32_t rt = (syndrome >> 5) & 0x1f; uint32_t reg = syndrome & SYSREG_MASK; uint64_t val; - int ret = 0; if (isread) { ret = hvf_sysreg_read(cpu, reg, rt); diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index 403b345ea3..32087b6f0a 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -924,8 +924,8 @@ DO_1OP_IMM(vorri, DO_ORRI) bool qc = false; \ for (e = 0; e < 16 / ESIZE; e++, mask >>= ESIZE) { \ bool sat = false; \ - TYPE r = FN(n[H##ESIZE(e)], m[H##ESIZE(e)], &sat); \ - mergemask(&d[H##ESIZE(e)], r, mask); \ + TYPE r_ = FN(n[H##ESIZE(e)], m[H##ESIZE(e)], &sat); \ + mergemask(&d[H##ESIZE(e)], r_, mask); \ qc |= sat & mask & 1; \ } \ if (qc) { \ @@ -2460,7 +2460,7 @@ static inline int64_t do_sqrshl48_d(int64_t src, int64_t shift, return extval; } } else if (shift < 48) { - int64_t extval = sextract64(src << shift, 0, 48); + extval = sextract64(src << shift, 0, 48); if (!sat || src == (extval >> shift)) { return extval; } @@ -2492,7 +2492,7 @@ static inline uint64_t do_uqrshl48_d(uint64_t src, int64_t shift, return extval; } } else if (shift < 48) { - uint64_t extval = extract64(src << shift, 0, 48); + extval = extract64(src << shift, 0, 48); if (!sat || src == (extval >> shift)) { return extval; } diff --git a/target/arm/tcg/translate-m-nocp.c b/target/arm/tcg/translate-m-nocp.c index 33f6478bb9..42308c4db5 100644 --- a/target/arm/tcg/translate-m-nocp.c +++ b/target/arm/tcg/translate-m-nocp.c @@ -506,7 +506,7 @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno, gen_branch_fpInactive(s, TCG_COND_EQ, lab_active); /* fpInactive case: reads as FPDSCR_NS */ - TCGv_i32 tmp = load_cpu_field(v7m.fpdscr[M_REG_NS]); + tmp = load_cpu_field(v7m.fpdscr[M_REG_NS]); storefn(s, opaque, tmp, true); lab_end = gen_new_label(); tcg_gen_br(lab_end);