From patchwork Tue Oct 10 11:50:47 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: 731453 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1701582wrw; Tue, 10 Oct 2023 04:52:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFe01zsjZzTQpGPYjDLm120r2quNjt55DUOuWpGFlC5GzHR87oChKFgiNNWVJ2CBP+1GZgX X-Received: by 2002:a0c:9799:0:b0:64f:3882:512a with SMTP id l25-20020a0c9799000000b0064f3882512amr17029928qvd.13.1696938721587; Tue, 10 Oct 2023 04:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696938721; cv=none; d=google.com; s=arc-20160816; b=O7KtjiA22fn9pKxv/Fwdow17IPX8C6EingI4jAXioDS3IROpIyEWuECWJUAnIRwVX0 I3PTbPnajX6+ddyTJb1KdpaBy61VWETQuzu0eOq8zhvyuBfpLVg3/H9mL+1dOSYW0C4a Y16mXygVg1VsutRJ7GbAGqt//j5IPNgsLplnbxNmy0dY99AqdlqIOVIcvdGIAQQTitsn 4L9ilnMXZR0zuVkDJIGQFYegJK6ftn9QYTeH60xrapVf6ZwdutlQB7uxEx1A1eP7I6WS sWGZ0v6ajJNj/iWTNpGFwZkkgRGGyYF3wZZSCLYHc2aR04n2QHG4iWrY6L1fs6BIBuDl QemQ== 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=oSRMhqRwBJPVwIvAMkL4U25xz5YfzMZvrXzYobWXOds=; fh=06c1SfXCDJsZD94qIZFbVOXNxhn2+zM3SMxozUzqBSg=; b=HscqpmMT2CvbCG7qCk5QB9SYyZ9kODIibTH6V9+spZpQWja+GUFYIWPvWpiHAL7Q5J ufa97ECTe8lghlKruYHmzmoovL822X2hkZugwB4Ur8q2WTlL30YLdR7XLbiwXG1xVjPc POqrzWT7v67wBBY0EIPhRmKtrXoCzTDawGKDIk+Vx72ZdvSO1W3fPS2rHugG7KE4c3/d CQis5bipXLY8G82wC4Gnwx6rke14Yoccq1/co+lg5Xqhng9MSY7JfyHREb6+houw4W9I o9hMeOuCFmB9dQKTGyYpp6Oxmu6xYN7CJ5l6d+NPK9q09yUC4cDh1hjq4uebIuRnQ6Hi sblQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aZwXzcN9; 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 ss6-20020a05620a3ac600b007758e5dba35si7249540qkn.484.2023.10.10.04.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 04:52:01 -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=aZwXzcN9; 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 1qqBGs-0008OG-Sq; Tue, 10 Oct 2023 07:51: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 1qqBGp-0008Jn-Vr for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51: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 1qqBGo-00076b-3l for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:27 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-99357737980so961579266b.2 for ; Tue, 10 Oct 2023 04:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696938683; x=1697543483; 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=oSRMhqRwBJPVwIvAMkL4U25xz5YfzMZvrXzYobWXOds=; b=aZwXzcN9K2MmNLQociQV1VDMAOblaU5WmvPoHhovxNiR1Q5MeQg9dfE0ZmLhn4oaoe HM8FR+ghRjW1gsXk4ofqHhn/YY1lEqRRIZdKYlDS5TFObpNf48ffviVgxAUwYzEGxavT kx7VRU3rnLDq1MiU5KyWpwdcNEdRmzHrnrFm1SatgeXPUBv/qvYYfJ+ArEMIdD4IJbbm uAMhRX7cNWSZI+w0k37A9TU5OZ3wVpyGUmT3ExKNNYJEEhgm5sb7kCO28WQ07nOVTi1f rcoKDLq/8aOR7nmWgSerGFvcH6J1q1tyQXjx1+hyZFBg+ycjPYn1+kNco6sRNdQDObG5 k+bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696938683; x=1697543483; 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=oSRMhqRwBJPVwIvAMkL4U25xz5YfzMZvrXzYobWXOds=; b=hHi9wS0G1nosKQHI3Gic6BrPc0Nh+IREho9QqK/IJj0PWePJRF3Kqg56TEc5S0LDL8 QmuNcO/vNe4fGDNnfHSTY2FoLYKZUquuKAAS+QFL/xoh8epW02tGN5GpJYTMXW/xzz80 kOOCAW7wPWstLCuN2IAHZUEk848XqHz1T6Aj4Iy2+Sgae4fguCF/JAlSa8MmsbMjJ2cQ J27T14seJ7dX2c3HNHpD7R0InF3EgpUtvG0ivD5oCExSLWHmGmQ2FrsHKFD0ZvP2cQfh JKpMs3cWFsEbbzTnUDu7fEG3zhfAqUaM59r6VWVjNU//+WFTBZTjAvzI1WHbBfpYzZDM gUVg== X-Gm-Message-State: AOJu0Yx2RA8gjNyoCmX9RhxljDvfj4SbetzuAJVsZ5qNVnNrgBEchmq4 3UuxwGLCUQ4K1vaHZaBU+P1XyptKnLcZ/bDoh/LqPQ== X-Received: by 2002:a17:906:53cd:b0:9ba:321b:80e3 with SMTP id p13-20020a17090653cd00b009ba321b80e3mr2847412ejo.20.1696938683432; Tue, 10 Oct 2023 04:51:23 -0700 (PDT) Received: from m1x-phil.lan (aif79-h01-176-172-113-148.dsl.sta.abo.bbox.fr. [176.172.113.148]) by smtp.gmail.com with ESMTPSA id bq17-20020a170906d0d100b00992b8d56f3asm8405985ejb.105.2023.10.10.04.51.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 04:51:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , Igor Mammedov , Richard Henderson , Ilya Leoshkevich , Gerd Hoffmann , Halil Pasic , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , "Michael S. Tsirkin" , Yanan Wang , Eduardo Habkost , Eric Farman , qemu-s390x@nongnu.org, Christian Borntraeger , Thomas Huth , Ani Sinha , David Hildenbrand Subject: [PATCH v2 5/6] hw/pci: Clean up global variable shadowing of address_space_io variable Date: Tue, 10 Oct 2023 13:50:47 +0200 Message-ID: <20231010115048.11856-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231010115048.11856-1-philmd@linaro.org> References: <20231010115048.11856-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: 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 --- 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;