From patchwork Thu Aug 31 22:56:04 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: 719039 Delivered-To: patch@linaro.org Received: by 2002:adf:e5c2:0:b0:31d:da82:a3b4 with SMTP id a2csp741838wrn; Thu, 31 Aug 2023 15:58:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEumf1CDcny/G43dkHxSItVEf9DtHsIGwq4tsglFWjt5TeaMGlyOXOMGqqUC72gTg80HccG X-Received: by 2002:a05:620a:24c7:b0:76d:a27c:245 with SMTP id m7-20020a05620a24c700b0076da27c0245mr1458178qkn.7.1693522727874; Thu, 31 Aug 2023 15:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693522727; cv=none; d=google.com; s=arc-20160816; b=DBvgWKl+BMuGA7SI3H9nCDpsqqDHbPk+WFt8RLQajU3opOq5mYRCbCiVLyMNS5y99Y PnV9yHYDW8/AzZVwVgfsxbqXnmqfJCHEvzMdRJpwKsAAkDiQ03Q7NLhlfrpOGRhfj7pl QSyJFGx44ggZRSri4fJ8pirKtTvukIZRoymjoigYyElGf0B0szPJr+sYNStna17c4Wjs WwdMpqPI1mMhUQezDKp1f/pqIJP0eQw+MVWs6gHiTJDnV4fpQEkFdvj947Q4gDY1ssCd 0W38Bq9HA7RkwWWJNPzfiF1q7q//8YGtrhfMXGekcAHBS1MSAVifMsxhMHeZurvLyh0u FoEA== 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=4KLx6XBhwZsbEqcvd2/L0DAF2KnkpBlHb/IZBmOztIQ=; fh=6kBnmdThd/Mtcn6GnZSOF8dqD10/+Dyg8jWJhZHC9H4=; b=bwgKD2RcbdhQ4ERFz6BClH90ueMTONGj4MZRJNU1gXqob5AFwbSqVRWQA3IhC36Dif 0Jm88L/j7yq5o9T/YZZQFLaLlZh6wSaaAASrJ8jk45k0xcZccgnKN55Nh6w6nXZag3Kx RaIus5RJvESnhBkfxwP93W49AlYR8N22NngdwN7taM0Jj7mXVC4kTBPWRGQ7NqyBKUXw m4fV684y9JH/1OG9rno7nqtX735jNhaRzQsBqLLHVw/qb2GH9YMDcS4IGmoL70G6Ozdo w10nmmKIcrdbRGDpC5AQGEevDa5i78sgvmWuzCWx0irmqA1Lk7hrEJtPOTDXxto3rLs1 RWNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YeGwrBIu; 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 t21-20020a05620a451500b00767eff18f66si1594935qkp.553.2023.08.31.15.58.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2023 15:58:47 -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=YeGwrBIu; 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 1qbqb7-0004Ug-Cw; Thu, 31 Aug 2023 18:57:09 -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 1qbqb5-0004TJ-89 for qemu-devel@nongnu.org; Thu, 31 Aug 2023 18:57:07 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbqb3-00038C-3w for qemu-devel@nongnu.org; Thu, 31 Aug 2023 18:57:07 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9a1de3417acso551233766b.0 for ; Thu, 31 Aug 2023 15:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693522623; x=1694127423; 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=4KLx6XBhwZsbEqcvd2/L0DAF2KnkpBlHb/IZBmOztIQ=; b=YeGwrBIuzjOTSmCeVjJ0kHsDobcKC4tY5b8eMQbxApar//mN0cp3kZIni6gJHA82s0 v3V64jpK/XFDcYolINV+s8QhM59Bq3a5/2ls1J11O8kjsapmtLiEX5cxPWXkmp8BRjRm Uv8yOPwmEtxUoLZXBKnTohZjfaXfrSDqocKkaCOG16cYptDz8Hnl2G9bTr3Ga3ydKg/3 ZU2ayDxvrPn1UwdqF/qQ6Shqf7slVdOBqUVzDNQ2E7VeDB4yd60SxfXtOIcRwsTKd8Fn RhpeBDKN6AVseHlnMBcj1vN/QR1Z309JdZiByDAimgeKjp1XiRff0B8lhBDL3nyy8Axf mbXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693522623; x=1694127423; 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=4KLx6XBhwZsbEqcvd2/L0DAF2KnkpBlHb/IZBmOztIQ=; b=jMVzwoS2H+mAtYkZE8L37/8zzzD18LGU2lITD2a2dM/Y73NTUskjA3luWxHrEK2H0t p1fuCtBDzGSrspDib40WrMuA/08kHT+jNwmutFYIYxJoJwci06u3osh2CPwJ62h4AsHl AtzVU89iHnarn6jfS6fEV6aLUHSyAdyBLaUrGQqSHLFDZ9eUkIIJ1Z6bQhdWOz+/dwlc WapOhG2BOR4u8TZH/RTNG6rXTFE3sCB8sZVoGO9X2Zr2H6Wb2jAL1HPJ74HzTDbK7vLC +Z8/eFyBwY42yUYvD1qXQyChz1nltf5dKKGVgu9sQEUmMtS9c9cBbWhVNb6rsepGyAc8 c+dw== X-Gm-Message-State: AOJu0YyqPtJwO5IFAXEs26diCWzchs+R1Krr+W5cDxIUmhQ35Y7d0LCz HzNzYYQP0Js+ByCyRRsQiZk+GGrINLEML9IELJI= X-Received: by 2002:a17:906:73d5:b0:99e:afd:f2ba with SMTP id n21-20020a17090673d500b0099e0afdf2bamr1190360ejl.35.1693522623707; Thu, 31 Aug 2023 15:57:03 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.245]) by smtp.gmail.com with ESMTPSA id t24-20020a1709064f1800b00992b1c93279sm1244368eju.110.2023.08.31.15.57.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Aug 2023 15:57:03 -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?= , John Snow Subject: [PATCH 09/11] hw/ide/ahci: Clean up local variable shadowing Date: Fri, 1 Sep 2023 00:56:04 +0200 Message-ID: <20230831225607.30829-10-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::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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 hw/ide/ahci.c:1577:23: error: declaration shadows a local variable [-Werror,-Wshadow] IDEState *s = &ad->port.ifs[j]; ^ hw/ide/ahci.c:1569:29: note: previous declaration is here void ahci_uninit(AHCIState *s) ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ahci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 48d550f633..8c9a7c2117 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1573,10 +1573,8 @@ void ahci_uninit(AHCIState *s) for (i = 0; i < s->ports; i++) { AHCIDevice *ad = &s->dev[i]; - for (j = 0; j < 2; j++) { - IDEState *s = &ad->port.ifs[j]; - - ide_exit(s); + for (j = 0; j < ARRAY_SIZE(ad->port.ifs); j++) { + ide_exit(&ad->port.ifs[j]); } object_unparent(OBJECT(&ad->port)); }