From patchwork Tue Oct 10 11:50: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: 731454 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1701602wrw; Tue, 10 Oct 2023 04:52:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWIwHvNNvh+KUUPr8dH2x1e6ZjxaRIbyf5QW13YVlSMpZ/9p30SvcBKMKWnj3OngQR0ygx X-Received: by 2002:ac8:5a42:0:b0:417:9c63:391c with SMTP id o2-20020ac85a42000000b004179c63391cmr24539415qta.52.1696938724641; Tue, 10 Oct 2023 04:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696938724; cv=none; d=google.com; s=arc-20160816; b=D2fsxmw8WwrWhvRR6UrDVas7Z1CQulmjc/n17U7911JroyeReKzazv+dLst07QN3RS nbBPy/cd0xQNfq7aJmSzYNRF0e5q1EFv3vU3R86iL5FtCc3VrBDCLOGQQFNEJGTdYaL+ YVniceEi0KtPK5Gkd8zgeqznppDO98pYqXUxeBwLbyC/NvHtE18OmPLaIteg4nPwseEi zYj7trnmqUluexwip/nu70EzGanR0Wy5rHBH+tm+mC6xkMPRF+V/AV4gRsnZVQYl4FbN 9rEYtIg1FWLL9Bk07pWJY3gXnBgIWHT+sPVxwHR3Eduk2+QdOl7q8X0m6GKhir4vKup8 g8XQ== 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=RzrCjZN13qxMauL0We9snVrFy91wRwtepgq3lfG8D4Q=; fh=06c1SfXCDJsZD94qIZFbVOXNxhn2+zM3SMxozUzqBSg=; b=plcA82Fbjsi5B23//k2UC2gBCfbR/rR1foridUT1kOyWW0E1DdAPQLxn7F/8HW92IG Sg15tHfXLjFuc+UkwMoLOcQkmRrZccn11UAYmjxcfP/W/TX92Sf5olGXucrN+VYmRwc9 Bu9ok6CL1hquB5FNSEo2NJBuwEqWQfiaPRC4gdQjBjAGlQhH09mf+ZqvE5Un75tICske VNSMH3f45ZyrbD7QbqZM2mSg8Nd2yFAUg+gE6Me4KCl2WqxElwgibHAeyjrP9UcXOB3D bGC98Ici3hq6FJhnZvbpxDEY8y7mVOEy7qxEynoD0SzoqQf5+FBgDE261JGvjWgG0/z3 /KqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BmWZQPh/"; 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 17-20020ac84e91000000b004165130b594si7661746qtp.530.2023.10.10.04.52.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 04:52:04 -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="BmWZQPh/"; 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 1qqBGg-0007q9-Vo; Tue, 10 Oct 2023 07:51:19 -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 1qqBGd-0007jd-I8 for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:15 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqBGa-00072L-Vf for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:14 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9b6559cbd74so1011596166b.1 for ; Tue, 10 Oct 2023 04:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696938671; x=1697543471; 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=RzrCjZN13qxMauL0We9snVrFy91wRwtepgq3lfG8D4Q=; b=BmWZQPh/CH71/xrEpyBGM5k69eox6bdhMbjqUl/Gw6WAuFL8byt67OHUYHK6wT9pNu 17d/cUNC4s+hYiwzOTtQvXB8i+9pz9iqpFhIARlrol3SKDWHfDW7Pwb6rJQPCwQhXOGP Ha1/mhbaAtPHzCYdE8pqTU0te3Fkcd+M6+VmJPGlu1W3UNSK+m8o++aD+u3EgP/9t9zt /fyXM638tLY/M+pO3kdHlVoUwNOshjErvEwBV25CzbfY0AUoO51UyD7a3pM+ISLb/fG7 /zPZHmFc6RgAlrcAwTkeg5HUKI64gnx43S5D1R33uKwfmydkgGQCE+VURelMbeUKiPCl ylhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696938671; x=1697543471; 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=RzrCjZN13qxMauL0We9snVrFy91wRwtepgq3lfG8D4Q=; b=i5YMjw7EjDdHD6tYjpX7QNWbkbsytgdxs3MnMBVR867j1wjlXfDGWfQP0iC3dm1DRO ZYXNEt7hWzGlL9fUPsWRuBELIxuT9ODnLRg8ndU91Z5uYjQsCY4d9HZjf5eePVdFIWcK o0hgjmsn3x/fdcM4OL1idLi3+4l7vyRX+yWA2v0j2wOjsTHrc+efrMDVi3MMOFU6hcM7 Z7TcheHxDoKaKKa3HdjyfGt5wor6AGYsUCSBsoooYqJEGGL4OlkIrZowDrCDePzjAeB/ cpADhTJ+CS/E2h1qsevHHPJeMhcm9Q+WAI3uPGd16+0JOElIizwX8Zz9vVo9AIx1YpIV VX4A== X-Gm-Message-State: AOJu0YxAjzLobuEaCg4C43u1nXY4olQ8dVnWw3ik99MoQ3DfpGA0NZlV D1fUqzQvQ6SGX+MG40yU92aMBSsFN5ke7ddv6YIalA== X-Received: by 2002:a17:906:209a:b0:9ae:69b8:322b with SMTP id 26-20020a170906209a00b009ae69b8322bmr15158000ejq.60.1696938670953; Tue, 10 Oct 2023 04:51:10 -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 g7-20020a1709067c4700b0099bd1a78ef5sm8320491ejp.74.2023.10.10.04.51.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 04:51:10 -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 3/6] hw/display/vga: Clean up global variable shadowing Date: Tue, 10 Oct 2023 13:50:45 +0200 Message-ID: <20231010115048.11856-4-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::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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: 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 Rename 'address_space' -> 'legacy_io' and 'address_space_io' -> 'io' to fix: hw/display/vga.c:2307:29: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] MemoryRegion *address_space_io, bool init_vga_ports) ^ include/exec/address-spaces.h:35:21: note: previous declaration is here extern AddressSpace address_space_io; ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/display/vga_int.h | 4 ++-- hw/display/vga.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index 7cf0d11201..0f5db522c2 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -157,8 +157,8 @@ static inline int c6_to_8(int v) } bool vga_common_init(VGACommonState *s, Object *obj, Error **errp); -void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space, - MemoryRegion *address_space_io, bool init_vga_ports); +void vga_init(VGACommonState *s, Object *obj, + MemoryRegion *legacy_io, MemoryRegion *io, bool init_vga_ports); MemoryRegion *vga_init_io(VGACommonState *s, Object *obj, const MemoryRegionPortio **vga_ports, const MemoryRegionPortio **vbe_ports); diff --git a/hw/display/vga.c b/hw/display/vga.c index 37557c3442..4dc6535ae5 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -2303,8 +2303,8 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj, return vga_mem; } -void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space, - MemoryRegion *address_space_io, bool init_vga_ports) +void vga_init(VGACommonState *s, Object *obj, + MemoryRegion *legacy_io, MemoryRegion *io, bool init_vga_ports) { MemoryRegion *vga_io_memory; const MemoryRegionPortio *vga_ports, *vbe_ports; @@ -2313,10 +2313,10 @@ void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space, s->bank_offset = 0; - s->legacy_address_space = address_space; + s->legacy_address_space = legacy_io; vga_io_memory = vga_init_io(s, obj, &vga_ports, &vbe_ports); - memory_region_add_subregion_overlap(address_space, + memory_region_add_subregion_overlap(legacy_io, 0x000a0000, vga_io_memory, 1); @@ -2324,10 +2324,10 @@ void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space, if (init_vga_ports) { portio_list_init(&s->vga_port_list, obj, vga_ports, s, "vga"); portio_list_set_flush_coalesced(&s->vga_port_list); - portio_list_add(&s->vga_port_list, address_space_io, 0x3b0); + portio_list_add(&s->vga_port_list, io, 0x3b0); } if (vbe_ports) { portio_list_init(&s->vbe_port_list, obj, vbe_ports, s, "vbe"); - portio_list_add(&s->vbe_port_list, address_space_io, 0x1ce); + portio_list_add(&s->vbe_port_list, io, 0x1ce); } }