From patchwork Thu Oct 19 21:17:45 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: 735636 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1732278wro; Thu, 19 Oct 2023 14:27:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEABl7m4+6buWqSv12yMixGqdgBOE53Kqj+we3jPN8axV251XoH08tOypi+regEsu/Y1yz2 X-Received: by 2002:a0d:dd8c:0:b0:58c:6121:48e8 with SMTP id g134-20020a0ddd8c000000b0058c612148e8mr112670ywe.33.1697750820553; Thu, 19 Oct 2023 14:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697750820; cv=none; d=google.com; s=arc-20160816; b=colQtJN4y7+Q6M/S0RcJOxsZuwvYzOr3HPhQBOe6dh58PDIKEXhuJ0ByrM5AC6QW/w oCGhm8hesTkkMHZBadaGsQ6rcC5GqXieu3L4alkVWvM6R3MV6+jjI3Bh+sL1C1wNyIuH AbET7eMORImqw2ICFrbusWIOC/b7MOBcVk9rr/dK8O9XzPwGSmr8DXxQ3h7ACHhIal7S MGD5+8LGy03yev+ItCWkX6beEmhrt4sBmDmIIcoqueX3LcEij3VR5WwZ3ZUgVxHD72tc rY8/zAXLYcbv2nHPFpYD/HCa9U/a3KVCjhFhL4aTlxF84+pe6ZUEYO68LML411rk8Fl2 8qUw== 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=JphZjrzTl79mhHMgBe5a65MwYyuf+BAarrB+apkBPKc=; fh=HsJnBu0udoMl2e2NS8rHSx0tRz1W37jeyQS25M8iQmY=; b=nVA1paniwvp1GxQNr/tt8283ePJniXsJ5aBH842Xq9uDhyUWjtS3NjOsG5+4GuEy5v QrWnjwkXcxqse9isQf7Mod8ZGnkh1tUsZ1MDmzU3NFV6JODahM7AVaCZA/A54gafuw2F kAwJCK/hvYkahUlWJUTcpHYh0/0Q6kFABwB7LYF+D6NcUVWHPrYqTL1htKhLKgr2GdPp 1E1qrOoUEnPwoimiDisIHukxmYWsn8o6JsZkkJFXtnV/U/34CjTGCO+ffb5ICNg4f3AN Gs8qiwOLE31i/ETrPuxC4QDAxYgx3lXb7m/XSgz4CHS6ORGQIXQQqcTfQM+B40IiYshu v3+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MwQnKa1Y; 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 kc21-20020a056214411500b0065b15942647si400617qvb.164.2023.10.19.14.27.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 14:27:00 -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=MwQnKa1Y; 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 1qtaRb-0008Tg-36; Thu, 19 Oct 2023 17:20:39 -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 1qtaRV-0008DN-Cr for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:20:33 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtaRS-0005a0-Bu for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:20:33 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32daeed7771so97581f8f.3 for ; Thu, 19 Oct 2023 14:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697750429; x=1698355229; 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=JphZjrzTl79mhHMgBe5a65MwYyuf+BAarrB+apkBPKc=; b=MwQnKa1Y/utQNk7vldVnonkqUAtxaNBs1E5KOc10G3rCcg5oa8OFN+fPGXP5B0Ic90 HEWxPaHcigYlqvRjStCEQF0pGsJNnzBEBZK6LVOjDkKQy0i3swC+8amq/pP4pl5fOBuQ rP3Y68qyEl/gRBBL/1DwOTXXMD66SPnkmd1Mj1bzS6g4nH5TrFa5B0Sd5nXaNhc20giX 7ifJjBQu1zYanDmVdtwM+eDLo1Oa/kvKKeFpdAwd+TZhYxxTw+I5j/5fqnajfltcIhid /gBHEuuAE8sh3gajHNaSXnzRzFRpWLX6TXGtMZ/OpwRZRGEX7pkrQZsJKEY4oNwv8qey lFLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697750429; x=1698355229; 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=JphZjrzTl79mhHMgBe5a65MwYyuf+BAarrB+apkBPKc=; b=uDfzm8NAbSwvphcLqbLvvho15jm+7ZGEmW1Dmtpfr2T6i/wPMf94iTL/r7xqQQlwOb ZLhCjg9yGXnzRsIZYkU+sf1Br3mgOz+kRUDQ1Llxnn81ObyWOS2ddFi6KGxVZ7HNX99d vyEULvPiRqAxQJdDElIuHPLL1jPYksraSssUJDREIV6Kc5o+Zmjc+oDP0F07qcQp5rzt 0gYy6CI2O0PhgxMTpH6r5mN4PLWT3MhIyqhF4m5hm3zjAZ49+C0npokxIIXujU+g98Zt DtRsw6HUfRBEAytTEY7UTpM4pNJQ3YDQrqslXdZ59Yy34z4oPbSUczT4RB42pq4XDFBg Q21g== X-Gm-Message-State: AOJu0YyZdcmazyqDed3vgZ6hU67Hk8i8EKchxyeZpC6YY+shLRnGePgZ OVZIgF2qQKPmMjiibV+aih3f6PkcLUHosMjy7kCgtg== X-Received: by 2002:adf:e802:0:b0:32d:b55c:41fa with SMTP id o2-20020adfe802000000b0032db55c41famr2277786wrm.28.1697750428731; Thu, 19 Oct 2023 14:20:28 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id o22-20020a5d58d6000000b003143867d2ebsm220609wrf.63.2023.10.19.14.20.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 14:20:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" , Marcel Apfelbaum Subject: [PULL 20/46] hw/pci: Clean up global variable shadowing of address_space_io variable Date: Thu, 19 Oct 2023 23:17:45 +0200 Message-ID: <20231019211814.30576-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019211814.30576-1-philmd@linaro.org> References: <20231019211814.30576-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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: hw/pci/pci.c:504:54: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ hw/pci/pci.c:533:38: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ hw/pci/pci.c:543:40: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ hw/pci/pci.c:590:45: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, ^ include/exec/address-spaces.h:35:21: note: previous declaration is here extern AddressSpace address_space_io; ^ Signed-off-by: Philippe Mathieu-Daudé Acked-by: Michael S. Tsirkin Message-Id: <20231010115048.11856-6-philmd@linaro.org> --- include/hw/pci/pci.h | 9 +++------ hw/pci/pci.c | 25 +++++++++---------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index b70a0b95ff..ea5aff118b 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -279,12 +279,10 @@ bool pci_bus_is_express(const PCIBus *bus); void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, const char *name, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, const char *typename); PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, const char *typename); void pci_root_bus_cleanup(PCIBus *bus); void pci_bus_irqs(PCIBus *bus, pci_set_irq_fn set_irq, @@ -304,8 +302,7 @@ int pci_swizzle_map_irq_fn(PCIDevice *pci_dev, int pin); PCIBus *pci_register_root_bus(DeviceState *parent, const char *name, pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, void *irq_opaque, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, int nirq, const char *typename); void pci_unregister_root_bus(PCIBus *bus); diff --git a/hw/pci/pci.c b/hw/pci/pci.c index b0d21bf43a..7d09e1a39d 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -500,15 +500,14 @@ bool pci_bus_bypass_iommu(PCIBus *bus) } static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min) { assert(PCI_FUNC(devfn_min) == 0); bus->devfn_min = devfn_min; bus->slot_reserved_mask = 0x0; - bus->address_space_mem = address_space_mem; - bus->address_space_io = address_space_io; + bus->address_space_mem = mem; + bus->address_space_io = io; bus->flags |= PCI_BUS_IS_ROOT; /* host bridge */ @@ -529,25 +528,21 @@ bool pci_bus_is_express(const PCIBus *bus) void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, const char *name, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, const char *typename) { qbus_init(bus, bus_size, typename, parent, name); - pci_root_bus_internal_init(bus, parent, address_space_mem, - address_space_io, devfn_min); + pci_root_bus_internal_init(bus, parent, mem, io, devfn_min); } PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, const char *typename) { PCIBus *bus; bus = PCI_BUS(qbus_new(typename, parent, name)); - pci_root_bus_internal_init(bus, parent, address_space_mem, - address_space_io, devfn_min); + pci_root_bus_internal_init(bus, parent, mem, io, devfn_min); return bus; } @@ -586,15 +581,13 @@ void pci_bus_irqs_cleanup(PCIBus *bus) PCIBus *pci_register_root_bus(DeviceState *parent, const char *name, pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, void *irq_opaque, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io, + MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, int nirq, const char *typename) { PCIBus *bus; - bus = pci_root_bus_new(parent, name, address_space_mem, - address_space_io, devfn_min, typename); + bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename); pci_bus_irqs(bus, set_irq, irq_opaque, nirq); pci_bus_map_irqs(bus, map_irq); return bus;