From patchwork Thu Aug 31 22:55:56 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: 719031 Delivered-To: patch@linaro.org Received: by 2002:adf:e5c2:0:b0:31d:da82:a3b4 with SMTP id a2csp741470wrn; Thu, 31 Aug 2023 15:57:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJtiRqMHpfN8cNe/bhIg3IZhTS9d5ooKftgKLqa9QAB/7NlZ7AadDGMOX2z9HJzHEWQeU5 X-Received: by 2002:a05:6358:9182:b0:13c:b1a4:3807 with SMTP id j2-20020a056358918200b0013cb1a43807mr698468rwa.14.1693522647561; Thu, 31 Aug 2023 15:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693522647; cv=none; d=google.com; s=arc-20160816; b=GNbpUg3DQzMFr1q3z+tq0z5wiKw3QrXSdW5m9dwyzIHJC7QmXsBJn1APofNP1dRSUV KDID22p+Se7xiHLDYjMXM6fftl6ct45iTgDbOb3RJaKMfbVESQURp68DvwyAgQ41dqj2 Jbs8WnlYqkm5Alf4RBZ/s+gcF9JBPVQ4Sg+u/WtysJ5DIS1Y15kaqPIstihHJc96x7xp Ye+aTe2g7froZ/g3ByqSoiSlo3X+ipEsGmGJ0AxmPestbzYrdJNQ7OaxnCv9BJUa3uIw 0GV90Jy7U8LL4TtvI2nYzoZ2G5nWZnh0BDU9HsvvKrowuPYUCHdy0b4wBvOvBkSVGXeP eHJw== 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=IhXUeI4Vxb8/8XVWSOD9CuNhg7dP6BSEsnXwUzw0chc=; fh=6OUBJuTwrh/5tyWnzl0bHTkgdMQjhVAgG4QSR4yXIQg=; b=iEszwhFm/DRfaNNEEcxaLnqYzVV/k5VIuCux/01R6JegDI3MdwcNsZtjmJgeU90mUk OlJ6itjWi3AeCHT01CrDlieVK94A4obYaog6yL50iLBjurJp+Lxbt//IwGCYGAt++Z2N 4UX3M+KW2Wz70MshmVORHNzepG4BCq71KCZUMw5ubVTdDlx6ibf7rE8a6dMhdN6q4vjn GyyvMbGrCoNftCQmwhUOLIF+6ouiZp+JZeL/MgEIGp7D9q67FVeQi1yaRBrdZ89gHwQA enZ0atJJkRSIteUDhfma/LtNGBi4S/ZhtykMMKCQYRas5MtRiwdp+LkA1eCuGSNloAFz 5awA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h4TVqjCi; 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 t20-20020a05622a149400b0040fbc9a3257si1469179qtx.115.2023.08.31.15.57.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2023 15:57:27 -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=h4TVqjCi; 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 1qbqaO-0003sd-F6; Thu, 31 Aug 2023 18:56:24 -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 1qbqaM-0003rm-I1 for qemu-devel@nongnu.org; Thu, 31 Aug 2023 18:56:22 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbqaJ-0002ov-3F for qemu-devel@nongnu.org; Thu, 31 Aug 2023 18:56:22 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9a58dbd5daeso168500266b.2 for ; Thu, 31 Aug 2023 15:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693522577; x=1694127377; 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=IhXUeI4Vxb8/8XVWSOD9CuNhg7dP6BSEsnXwUzw0chc=; b=h4TVqjCiUoPAAL9NKP3pvD8CJnd+kSGZwhjZW0ZJwZuKd02OwA4jhSQ/BUN36Ii4+e 4RWIenZyCI1HVxJgH9XKFlrSernhL8TchkYkYxGtYe0DlYKyICK542yoInGTssPbi9Lx NaPfDamMer6iTQm+Mxuc1ANT7GnA7VIO/ujcRJUqemWgIAvYzBRF14eLh7s91HvHxWol WCbCecqoJ+kZmqgRJKF2F4PZJNajN5phngIC1mtHuZmFT+1vT7LAOTcY0puK+L8S1i7e tf7vpqGm0N2NuAazW1ucrMOjhHnNgBdMBnLjT0ZIqjNpHooFwNMLiWimC7hjRbBDCd7y 12gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693522577; x=1694127377; 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=IhXUeI4Vxb8/8XVWSOD9CuNhg7dP6BSEsnXwUzw0chc=; b=JMX/kMEmdi5lEW+DnwuzAPV/AaP9tLG0Sr/28Sk6F81VeMCy0e4h5U38c+nESXK9WU jONqRLrEsNf6TVgMlHJV4i1uhiKQFnGil/onpFh9leIWCP7M1Tg761S6hBi9KNyj3snP 5j5xgS2C+tejQOn3Jq+qtahnKGt37XXOGWAzU1YhQ2/Ri6Bzqa8EvpLh8PgXsopAQD29 +/f3SogOT+RsbMNQea8c0R70SgLXzxPXgyFKhE23GoLhnIe8lCg3dA66ckxBf+T9GPjm jEzrpg6E2Gqd8M4aKqaBOpKoZX+6U0/f4jzlVkLhCbmK+G0vBZKu5fQsKZFzbmqxdPVx XQ+A== X-Gm-Message-State: AOJu0YyxS8aeYlOgB8kDoT0b2NA/RIlOCGFWs+dvPBYRPqM7yZq4WDcl qVfIUEjzsvzjEWtbyaUuCTfG7ij3fnu/di9Y2uA= X-Received: by 2002:a17:907:75d7:b0:99e:39d:4fa7 with SMTP id jl23-20020a17090775d700b0099e039d4fa7mr507867ejc.22.1693522577289; Thu, 31 Aug 2023 15:56:17 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.245]) by smtp.gmail.com with ESMTPSA id m26-20020a170906259a00b0099ca4f61a8bsm1265876ejb.92.2023.08.31.15.56.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Aug 2023 15:56:16 -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?= , Richard Henderson , Paolo Bonzini Subject: [PATCH 01/11] tcg: Clean up local variable shadowing Date: Fri, 1 Sep 2023 00:55:56 +0200 Message-ID: <20230831225607.30829-2-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::634; envelope-from=philmd@linaro.org; helo=mail-ej1-x634.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: tcg/tcg.c:2551:27: error: declaration shadows a local variable [-Werror,-Wshadow] MemOp op = get_memop(oi); ^ tcg/tcg.c:2437:12: note: previous declaration is here TCGOp *op; ^ accel/tcg/tb-maint.c:245:18: error: declaration shadows a local variable [-Werror,-Wshadow] for (int i = 0; i < V_L2_SIZE; i++) { ^ accel/tcg/tb-maint.c:210:9: note: previous declaration is here int i; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/tb-maint.c | 3 +-- tcg/tcg.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index c406b2f7b7..f1cf3ad736 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -207,13 +207,12 @@ static PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc) { PageDesc *pd; void **lp; - int i; /* Level 1. Always allocated. */ lp = l1_map + ((index >> v_l1_shift) & (v_l1_size - 1)); /* Level 2..N-1. */ - for (i = v_l2_levels; i > 0; i--) { + for (int i = v_l2_levels; i > 0; i--) { void **p = qatomic_rcu_read(lp); if (p == NULL) { diff --git a/tcg/tcg.c b/tcg/tcg.c index 620dbe08da..46a3a231b8 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2548,21 +2548,21 @@ static void tcg_dump_ops(TCGContext *s, FILE *f, bool have_prefs) { const char *s_al, *s_op, *s_at; MemOpIdx oi = op->args[k++]; - MemOp op = get_memop(oi); + MemOp o = get_memop(oi); unsigned ix = get_mmuidx(oi); - s_al = alignment_name[(op & MO_AMASK) >> MO_ASHIFT]; - s_op = ldst_name[op & (MO_BSWAP | MO_SSIZE)]; - s_at = atom_name[(op & MO_ATOM_MASK) >> MO_ATOM_SHIFT]; - op &= ~(MO_AMASK | MO_BSWAP | MO_SSIZE | MO_ATOM_MASK); + s_al = alignment_name[(o & MO_AMASK) >> MO_ASHIFT]; + s_op = ldst_name[o & (MO_BSWAP | MO_SSIZE)]; + s_at = atom_name[(o & MO_ATOM_MASK) >> MO_ATOM_SHIFT]; + o &= ~(MO_AMASK | MO_BSWAP | MO_SSIZE | MO_ATOM_MASK); /* If all fields are accounted for, print symbolically. */ - if (!op && s_al && s_op && s_at) { + if (!o && s_al && s_op && s_at) { col += ne_fprintf(f, ",%s%s%s,%u", s_at, s_al, s_op, ix); } else { - op = get_memop(oi); - col += ne_fprintf(f, ",$0x%x,%u", op, ix); + o = get_memop(oi); + col += ne_fprintf(f, ",$0x%x,%u", o, ix); } i = 1; }