Message ID | 20230904161235.84651-15-philmd@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp1688305wrh; Mon, 4 Sep 2023 09:18:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqXYY+sOrBc46JEPc3ySAxzTyN59gtwwGryGsjbBsfLf7LOlCuGXx5N9Z2nY8Vc3ZBNPrD X-Received: by 2002:a05:6808:3092:b0:39c:59e2:dd79 with SMTP id bl18-20020a056808309200b0039c59e2dd79mr14519388oib.36.1693844285113; Mon, 04 Sep 2023 09:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693844285; cv=none; d=google.com; s=arc-20160816; b=wVnp6Lk6GwkPlUnRUJ1wExwWWzNlRP0oVS1Y/R0dmqeh0/o7ItOgyaPXYZqDdfRgRC iIKKTxs2sitUl3hQXCokxY8+PUA+4WSyNIZSlogdmxqyiI0seA5n9y1Ol8I7XXfX5ync 8cKJ6Ox3CoMxLQ8uMJN9U8kbCTDTpdAlNsG4118vMHmWGb5pPhMQOlTt37rs6POV6Dvx RpFbScgkg8KmYGn1KAlmZKxC49FeGgC8lhUQuXU2wOWtOz2CSMLZ3CUfejGjH1Nqchz1 62k8Py+76P+5Gus9KxP1fk9vh0RBi52UPNBXJLu1UHNF+0RBwkG1+87e1zVij6h7PoiF 3RrA== 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=1py6WJ7lyP7JjfX18bziMc96oyFqE8D3chzbCT/Lnv8=; fh=/VsiGXSITn7Xm1R7BExfmeuAsw3bqogA9P0rdoE9plc=; b=at+tHN8rJ5AV05MV6F7MGop3pfTxpk0QvNKQDyGXs5E+JySY/TxohjC2fSM6KUtpyN aEBsr1S6oGo4LAjiG9TWFr0EXMr/CTjCCdcR52JJp8ZxnvlSJoQbnw/Jf3j5Xxm9KBZQ Mgbj2vxFpL0eCyYpFhKO2gAEOvsRCxtfKxfqcBxqBB47QJxaaze5av45kOw3EYdWEFyj LFzd5wjweaeADrdHCvUFFDC/f8D0JnkAmZmp358h7obHFGvj6wIM302LVs27oW4+t6ab CbVbXPyaFctxXkbDehfQ+0mg8XqKoEVKV4kZceNhZpbG8aP6cl+nIhakqx0mPKTSn3S3 Q7Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MNd3w8XO; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 21-20020ac84e95000000b0040ff1f5a4dasi6553663qtp.412.2023.09.04.09.18.04 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2023 09:18:05 -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=MNd3w8XO; 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 <qemu-devel-bounces@nongnu.org>) id 1qdCDL-0004Bu-B3; Mon, 04 Sep 2023 12:14:11 -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 <philmd@linaro.org>) id 1qdCDC-0003bT-8o for qemu-devel@nongnu.org; Mon, 04 Sep 2023 12:14:03 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1qdCD9-0007fn-WE for qemu-devel@nongnu.org; Mon, 04 Sep 2023 12:14:01 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-52c9be5e6f0so2037864a12.1 for <qemu-devel@nongnu.org>; Mon, 04 Sep 2023 09:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693844037; x=1694448837; 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=1py6WJ7lyP7JjfX18bziMc96oyFqE8D3chzbCT/Lnv8=; b=MNd3w8XOTB9J+rzeWLWgsDrMqDCWYGGHhv5W9sS13eAhto5q8PYFGcP7boDYDASpUF Q3YLHb1B3TJAX5Bt0XaPrjvmlYh45s3cmHxpJbKWXomblQz9QfJ6KRVscy0yZgt+G2LJ WdG8HIOZc1Mu8icYy335Temn2aUFP8LnOqBKTQzYyq3YJwcMHTuWQw1yZ45BC+w1cX1g PWXaViyIrcx1xr2FkdwNjp3N0iP+/uuk4OM9eY2Vt5T/K+rDerjCn/LPOArVDryG2DG2 P/i2012cSyQR2HSToDcXRfQR600ud6prMgyVJsosAltiG7tCx/uKlXOcLjeRnj2AnlV+ hdSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693844037; x=1694448837; 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=1py6WJ7lyP7JjfX18bziMc96oyFqE8D3chzbCT/Lnv8=; b=LLOS/YJGeovqFRYCozacULZW6ev9xHCLUeKzAPo+Xud9xELvk0w96JUyyZP+Mb7MYJ m5ZheJa3j167Da0V0AkbwhWX/PBfgkyZPdPCb/mTY9t7Dr3O1DQ6i2iy2sCx/zh78BMf b8IARjTpd/xiKgZrfarlf6Xctai7z2O/EjAh8qkU97R2zGxdsSHpO2WGlCD0VqB67cls nFHGzr+U1mtY84V5r6ExXw/EfWZ8sqwV/fdDZCtavkVjFzQnQ0cYYzEbtstLfPJ0LWTA o9E90PiXGqMPhi2uVSxTah+IDzZyzyMkFb6giJ4InT0mglSnTM3kqZvCPwZ4AF4AbxPw 7XVw== X-Gm-Message-State: AOJu0YztW7lMyFVFvxgQvUMC4Mf5UvY3Aa2xyhzfQXvdzIYLQWD43lux rJtvSGGdq28Fc6XQdSn+ilvb78CIRMB8CfjxHMg= X-Received: by 2002:a17:906:70d6:b0:9a1:6318:4d39 with SMTP id g22-20020a17090670d600b009a163184d39mr7494768ejk.29.1693844037451; Mon, 04 Sep 2023 09:13:57 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id xo9-20020a170907bb8900b0099cbe71f3b5sm6306309ejc.0.2023.09.04.09.13.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 09:13:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= <philmd@linaro.org>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de> Subject: [PATCH v2 14/22] hw/nios2: Clean up local variable shadowing Date: Mon, 4 Sep 2023 18:12:26 +0200 Message-ID: <20230904161235.84651-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230904161235.84651-1-philmd@linaro.org> References: <20230904161235.84651-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
(few more) Steps towards enabling -Wshadow
|
expand
|
diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index 91383fb097..952a0dc33e 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -98,7 +98,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); if (nms->vic) { - DeviceState *dev = qdev_new(TYPE_NIOS2_VIC); + dev = qdev_new(TYPE_NIOS2_VIC); MemoryRegion *dev_mr; qemu_irq cpu_irq; @@ -107,7 +107,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) cpu_irq = qdev_get_gpio_in_named(DEVICE(cpu), "EIC", 0); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irq); - for (int i = 0; i < 32; i++) { + for (i = 0; i < 32; i++) { irq[i] = qdev_get_gpio_in(dev, i); }
Fix: hw/nios2/10m50_devboard.c: In function ‘nios2_10m50_ghrd_init’: hw/nios2/10m50_devboard.c:101:22: warning: declaration of ‘dev’ shadows a previous local [-Wshadow=compatible-local] 101 | DeviceState *dev = qdev_new(TYPE_NIOS2_VIC); | ^~~ hw/nios2/10m50_devboard.c:60:18: note: shadowed declaration is here 60 | DeviceState *dev; | ^~~ hw/nios2/10m50_devboard.c:110:18: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 110 | for (int i = 0; i < 32; i++) { | ^ hw/nios2/10m50_devboard.c:67:9: note: shadowed declaration is here 67 | int i; | ^ Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/nios2/10m50_devboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)