From patchwork Mon Oct 9 09:47:41 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: 730972 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1116211wrw; Mon, 9 Oct 2023 02:51:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvC1apzr3DtYNuiQpoSurY7GeFB5IcJda3mLINez4IBWKeVc6/eFERohD+QC3tpEGKMc9B X-Received: by 2002:a0c:f34a:0:b0:66a:f6ee:26ac with SMTP id e10-20020a0cf34a000000b0066af6ee26acmr7347931qvm.2.1696845064184; Mon, 09 Oct 2023 02:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845064; cv=none; d=google.com; s=arc-20160816; b=CV5U9UWXlQ1VfpBqMHmrxmFo4YCl6t//hvwjB6aV5Cjk4d5d19pkdZQ9iTbzJ+lLor J6TnWRX0vtnd9/Wdm3kb6cNtfB4bKjlWQCLxRluJ0jw2VthmzSxdplOs5KIptmz5Rzeg tDogWCn+Fj4W4WvVb0KS2QZyJW+3q4Zwe6laW4doL9RqnZx72gEf7j37NY82uQtAl82C o3RqvfHAmmmz9ylyVB07eXH2XIzs40fM1lDckkhyhmadhwYjEiYQRYWK2VtSXYb5ZNwN hKcDD+w676d/KKMsFDLGtMvnpeTsDcyqdBiY0TbZnPQHtPnuU7yhzfix3UUFbDdSCKqI NdjA== 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=vq0Txo18oKNgqgLa0NbVIIUbcU1WzhTxJcpN9pagyhs=; fh=n4SzPhYKXn8xRxTgdSQ5YZq0XW28GvXJqV224ul7a6o=; b=qxwDcKByByRU9Wgah5fhXUQHks263iq0OcLIEBqrR9IpetZIgkDDVUi/8xgs8jhI1d DgNbz9C3ZZbYe8V2VSBdnrY0U+G0leIsyJID/ZeTLk2lU2kJDzOZYKbVhF9c/PT4xHGi 9unVYyZ3QdPcJAWCqRqYcQQZQzctKZjNDssTyM/SspFdFzItK+tRinXE+Lfzy6EVvnH9 R0A1SzzSdEPJzTY03bYnwOgYedkfRaPk0hd/jccd/l5jaVVSARZdDSinJPcz4CbaCJGi MPJGtRtMmLeuLr7mkwfCnUAT85bK1GY+y39mp/ynwVFdWxjKSjK49PXtbYdEWcYMhBk1 IxOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xIhzdOZ7; 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 qc2-20020a05620a654200b0076db2a74a65si5696458qkn.174.2023.10.09.02.51.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:51: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=xIhzdOZ7; 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 1qpmsF-0001ui-CV; Mon, 09 Oct 2023 05:48:34 -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 1qpmro-0001T6-Gn for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:03 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpmrm-0005wb-Kx for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:00 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9ba081173a3so360539666b.1 for ; Mon, 09 Oct 2023 02:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696844877; x=1697449677; 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=vq0Txo18oKNgqgLa0NbVIIUbcU1WzhTxJcpN9pagyhs=; b=xIhzdOZ7cG7ZkZ1Po3OLADTikCBdSXQOS3cwnmJLv0eYQ8c4uXO0nWcAWrv0KuPUvV tg9WoSHZ2fTcHhXrpuhKg/41BUVm/gZHvpux9Uk7sklk+9sNFpHSvDlp5wzy/WcH1M40 8fRPhP2G827i8tZfgvmPkWlXoDN48QHl1OGlAVl1ujFCyKB2eDHBJYcKy3HHciKX+ucE ijNs37drjC4mS0SPLntqT8rcrzES8AQluSNwGkG3bGyGYTMpuhlwNareouvl0GCrRtqb qqhpGist/NwqbuOC5uHvYU7NJD4Yx4AtaeyyG6tmvk6QbvWcEdUy8n2+lHUsomAYr7Qy l6dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696844877; x=1697449677; 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=vq0Txo18oKNgqgLa0NbVIIUbcU1WzhTxJcpN9pagyhs=; b=HLY3BDwIMtB3t32Irp2e6H1T60DHU7h07euD7oSIxpPC87nmQrzytGbGFDgDSf5wik o0So4afsgO2RS6wTZMMKCdomNLK0kem/BgzCdFG/LWA8r03FHMPhicCUlpwXj1Awx93V yJ7TQx4SsnTyvBv5RwhuohDMIjnqdjpmFqJnEFVdlmMjeFc6CAMpxE9fv07hn6JZfiQv kt5xcsqRgiGIjCbLsCGDasjWiqIT7vvGNjgsJswK9tXCEptN8O10W5Vi422stmaZbfMa KEIs+fylEOKGQldxVFLgpzxmprExVxPfX8Tq4lswelf+Cgo4kcfLaD/VUmhq8lrcqIPA iSKQ== X-Gm-Message-State: AOJu0YwzfnxHayece5lPW+46N0ZIG3mx1nu4BtygXpbl1pYeERLtrgAl OihzRdXT0gI6FQ4+m3L1Kste2ViAGVwd27lMWKM= X-Received: by 2002:a17:906:1ba1:b0:9ba:2fe3:c97e with SMTP id r1-20020a1709061ba100b009ba2fe3c97emr377767ejg.11.1696844876878; Mon, 09 Oct 2023 02:47:56 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id l7-20020a170906414700b009ae69c303aasm6506561ejk.137.2023.10.09.02.47.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:47:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Christian Borntraeger , qemu-s390x@nongnu.org, Paolo Bonzini , Ani Sinha , "Michael S. Tsirkin" , Igor Mammedov , Yanan Wang , David Hildenbrand , Eric Farman , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Thomas Huth , Halil Pasic , Gerd Hoffmann , Ilya Leoshkevich Subject: [PATCH 1/6] hw/core/cpu: Clean up global variable shadowing Date: Mon, 9 Oct 2023 11:47:41 +0200 Message-ID: <20231009094747.54240-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009094747.54240-1-philmd@linaro.org> References: <20231009094747.54240-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.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 Fix: hw/core/machine.c:1302:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const CPUArchId *cpus = possible_cpus->cpus; ^ hw/core/numa.c:69:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] uint16List *cpus = NULL; ^ hw/acpi/aml-build.c:2005:20: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] CPUArchIdList *cpus = ms->possible_cpus; ^ hw/core/machine-smp.c:77:14: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] unsigned cpus = config->has_cpus ? config->cpus : 0; ^ include/hw/core/cpu.h:589:17: note: previous declaration is here extern CPUTailQ cpus; ^ Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 ++++---- cpu-common.c | 6 +++--- target/s390x/cpu_models.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e02bc5980f..d0dc0a1698 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -586,13 +586,13 @@ static inline CPUArchState *cpu_env(CPUState *cpu) } typedef QTAILQ_HEAD(CPUTailQ, CPUState) CPUTailQ; -extern CPUTailQ cpus; +extern CPUTailQ cpus_queue; -#define first_cpu QTAILQ_FIRST_RCU(&cpus) +#define first_cpu QTAILQ_FIRST_RCU(&cpus_queue) #define CPU_NEXT(cpu) QTAILQ_NEXT_RCU(cpu, node) -#define CPU_FOREACH(cpu) QTAILQ_FOREACH_RCU(cpu, &cpus, node) +#define CPU_FOREACH(cpu) QTAILQ_FOREACH_RCU(cpu, &cpus_queue, node) #define CPU_FOREACH_SAFE(cpu, next_cpu) \ - QTAILQ_FOREACH_SAFE_RCU(cpu, &cpus, node, next_cpu) + QTAILQ_FOREACH_SAFE_RCU(cpu, &cpus_queue, node, next_cpu) extern __thread CPUState *current_cpu; diff --git a/cpu-common.c b/cpu-common.c index 45c745ecf6..c81fd72d16 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -73,7 +73,7 @@ static int cpu_get_free_index(void) return max_cpu_index; } -CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus); +CPUTailQ cpus_queue = QTAILQ_HEAD_INITIALIZER(cpus_queue); static unsigned int cpu_list_generation_id; unsigned int cpu_list_generation_id_get(void) @@ -90,7 +90,7 @@ void cpu_list_add(CPUState *cpu) } else { assert(!cpu_index_auto_assigned); } - QTAILQ_INSERT_TAIL_RCU(&cpus, cpu, node); + QTAILQ_INSERT_TAIL_RCU(&cpus_queue, cpu, node); cpu_list_generation_id++; } @@ -102,7 +102,7 @@ void cpu_list_remove(CPUState *cpu) return; } - QTAILQ_REMOVE_RCU(&cpus, cpu, node); + QTAILQ_REMOVE_RCU(&cpus_queue, cpu, node); cpu->cpu_index = UNASSIGNED_CPU_INDEX; cpu_list_generation_id++; } diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 98f14c09c2..b1e77b3a2b 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -756,7 +756,7 @@ void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga, const S390CPUDef *def = s390_find_cpu_def(type, gen, ec_ga, NULL); g_assert(def); - g_assert(QTAILQ_EMPTY_RCU(&cpus)); + g_assert(QTAILQ_EMPTY_RCU(&cpus_queue)); /* build the CPU model */ s390_qemu_cpu_model.def = def; From patchwork Mon Oct 9 09:47:42 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: 730969 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1116164wrw; Mon, 9 Oct 2023 02:50:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHA7IGgvhkdkJ8eyPduBlrUM3ZVzmm/KgXvJ3jdYUbBQ1ss658dNrgKJDtmzuAJu6Zj7U5Z X-Received: by 2002:a0c:f80e:0:b0:655:e12d:d42d with SMTP id r14-20020a0cf80e000000b00655e12dd42dmr16135161qvn.28.1696845058168; Mon, 09 Oct 2023 02:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845058; cv=none; d=google.com; s=arc-20160816; b=0Ap8C9O90B5zSJ6KuHRR3J9IhmI89cQy5uW0MFCc6K48hb0auHQCirX1ayZDgybCi/ ln5qdSu/NOdPcNiVJvTLaxXQ4MDFrpmBodqCwA4hzEL9hTY5sEbfvJRMAQUD9nRaQJSy rDi4XQ9CmWRFOnbc02i7uwObzfp9aSfXaQ7Lu8mN218H+3d9VLoz9FR8zMHaOp0qAqyh VIomFhsUlsBe2Et6aiidyh20//PxkX2p4VfC2+wnx1TJ5rCIYP+kRFuq0gcSnVR+TRlz hH9Hhrx5aKJzvGumRYFTcQYBZc9ojK8ytOtRRbVf8LT7bZ8BpOMhsNrgpEhwtMffEoqd p8DA== 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=QjIFUd9EeYCQO/H7VS1vP3CjmTEJO6hAfPQ2q7h2ewE=; fh=n4SzPhYKXn8xRxTgdSQ5YZq0XW28GvXJqV224ul7a6o=; b=UFugimmmSIJlvcMVCp5yNtWu/kOldH/nyeZlmgcXF+biFJKYGl88hqvrQnsbE9FOJD ofEv0GYuNUybOkmIIJ0gCwJ2wIxNY2Vyb64usVL1u1KT56QIWkzxisCcxtzG6+TjYkm1 FVe3/nnB5KRF4hGCcnfzFdqFF5wB7Q/pG6oMnW7AH4R2xfXmLxsV6Igyk6bc4clve73Z gFCYde7mOh3mDeonKky8IYfujDujGRIlWdICJH2JGKmo3TA3z22IOsA5rFsbJ5KAER/P L6BTF5Yvf64WPruGn4lppAABy1e02diLnk/As08hFjONiu4T7EWc3PgNDJiOObRIjQzd RkzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sw4h7STN; 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 r15-20020a0ccc0f000000b0065b11081339si5788502qvk.417.2023.10.09.02.50.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:50:58 -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=Sw4h7STN; 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 1qpmt9-0003Ht-Lj; Mon, 09 Oct 2023 05:49:25 -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 1qpms3-0001sk-1X for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:17 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpmrw-0005xX-8K for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:14 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-533f193fc8dso7490490a12.2 for ; Mon, 09 Oct 2023 02:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696844883; x=1697449683; 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=QjIFUd9EeYCQO/H7VS1vP3CjmTEJO6hAfPQ2q7h2ewE=; b=Sw4h7STNnHObyngFRp7jim4pUrqYPwGpm4PG3VMD8WRDKYpT0aFXYd60ZBtY/tJTdQ 9MossDNHTCposqOs1ieDtMSxlly/g7XE4av5EeTYILDUrTkHCoS9rFHCvcUDgwKKCyOr 4Elk7+JyK8IiXFwPYhASSF2hv10tapsc5N10eVETFwZGwRw1HtgP3R8MGnnwe8RLZVVy 4Yr9RLMsvz3I3Gkwy7bPG6uQxBNeQyJGL7mt3+vRIFkTJBVKI1WAIN/grdko8FosZOhy I+kVDyvBlY6LBbwCiZTADK3xjAbImMe1mQgo9Ga6HjsAWOrr51j8SocqWUKvqD1n7pQ+ BzGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696844883; x=1697449683; 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=QjIFUd9EeYCQO/H7VS1vP3CjmTEJO6hAfPQ2q7h2ewE=; b=fGxKh8jUuob07m+Zn5kX31jIaWkDKJEEncLDD5wAFSe0oUF0X/41i0ynhQqzlq/aly 0M6cZpZjTjdtIYOAwsnC+dAftABc9MHjAIMN6NK4HXvS2pW16yQaQReAjlfpGkjmehqZ 5dJf21GuR/qUUG6wfTGu7mTFZ8mrn8M6S0kQT/ndHQt6eawYHp2XPRycTOu4OasGyA+k Liz52BbrzOW6a+E+7XiVkIZ77lAPiabKRoSGWB30ZFf9EAWV/MEcfM9UeHA1fQNOP2nD 951YmJgr7l+GrnyWAd2f2MgvgXVVh/+pp5bh3xswtnH9Q2+usvTz5kTi+8hDxbhhILId J8Gw== X-Gm-Message-State: AOJu0YxSwq0he/UOev94Roz6EbVLv3sUFDqfbB0flMDpcWAozC8Wf20g nXFxneKXf3S+7/kPiANxCQgPziyhpWGDjTfgRlg= X-Received: by 2002:a05:6402:355:b0:523:d51:bb2 with SMTP id r21-20020a056402035500b005230d510bb2mr11341808edw.15.1696844883379; Mon, 09 Oct 2023 02:48:03 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id c25-20020aa7d619000000b0053622a35665sm5802067edr.66.2023.10.09.02.48.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:48:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Christian Borntraeger , qemu-s390x@nongnu.org, Paolo Bonzini , Ani Sinha , "Michael S. Tsirkin" , Igor Mammedov , Yanan Wang , David Hildenbrand , Eric Farman , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Thomas Huth , Halil Pasic , Gerd Hoffmann , Ilya Leoshkevich Subject: [PATCH 2/6] hw/loader: Clean up global variable shadowing in rom_add_file() Date: Mon, 9 Oct 2023 11:47:42 +0200 Message-ID: <20231009094747.54240-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009094747.54240-1-philmd@linaro.org> References: <20231009094747.54240-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.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/core/loader.c:1073:27: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool option_rom, MemoryRegion *mr, ^ include/sysemu/sysemu.h:57:22: note: previous declaration is here extern QEMUOptionRom option_rom[MAX_OPTION_ROMS]; ^ Signed-off-by: Philippe Mathieu-Daudé --- include/hw/loader.h | 2 +- hw/core/loader.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/loader.h b/include/hw/loader.h index c4c14170ea..8685e27334 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -272,7 +272,7 @@ void pstrcpy_targphys(const char *name, ssize_t rom_add_file(const char *file, const char *fw_dir, hwaddr addr, int32_t bootindex, - bool option_rom, MemoryRegion *mr, AddressSpace *as); + bool has_option_rom, MemoryRegion *mr, AddressSpace *as); MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len, size_t max_len, hwaddr addr, const char *fw_file_name, diff --git a/hw/core/loader.c b/hw/core/loader.c index 4dd5a71fb7..7f0cbfb214 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1070,7 +1070,7 @@ static void *rom_set_mr(Rom *rom, Object *owner, const char *name, bool ro) ssize_t rom_add_file(const char *file, const char *fw_dir, hwaddr addr, int32_t bootindex, - bool option_rom, MemoryRegion *mr, + bool has_option_rom, MemoryRegion *mr, AddressSpace *as) { MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); @@ -1139,7 +1139,7 @@ ssize_t rom_add_file(const char *file, const char *fw_dir, basename); snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name); - if ((!option_rom || mc->option_rom_has_mr) && mc->rom_file_has_mr) { + if ((!has_option_rom || mc->option_rom_has_mr) && mc->rom_file_has_mr) { data = rom_set_mr(rom, OBJECT(fw_cfg), devpath, true); } else { data = rom->data; From patchwork Mon Oct 9 09:47:43 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: 730967 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1115775wrw; Mon, 9 Oct 2023 02:49:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbWPdBku/2dmCvscZdPfMV2/xmxBscjvqtAww5O1nRl5tQhDEmiGwr7ZMwlz8neHT/yti/ X-Received: by 2002:a05:622a:1787:b0:410:9626:f0bf with SMTP id s7-20020a05622a178700b004109626f0bfmr16396248qtk.13.1696844983740; Mon, 09 Oct 2023 02:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696844983; cv=none; d=google.com; s=arc-20160816; b=IQ0kHTZe3cBoUjJWrki5gQN5rs5oC9nds+MnUtld7UwpyOFyT1ukHUibO46gD1fzZZ +pHQCGhqjCKJ90HppDRjwaBt8fx+LkxjobZ2gDzW9i5luPsP7K5fABaA/DPGfyiaMTCc rF8aM/nnKWtf+EHVcGsmx0p9Zp1aMQb/8o8uaWhvdZ5TZcpewUVi4UiooaiTVzbVslDW EDLxonBynqNHcbnxMXim838ZsnGLL8gNLJotpavWD3WqnSJlGa4WMTXXmk8C9mM0Mv98 +PxxkP1L1bXXpOyyO7O2r1+CX9ZF+UM4/v4rvqlipB6n2sJ/kQKwjuO2yzF2vl2wOfha 4GNA== 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=kTqd6Z2Np7lV/f6CqV3RTrP/+37x/Q8ZcMxW6GyXvyM=; fh=n4SzPhYKXn8xRxTgdSQ5YZq0XW28GvXJqV224ul7a6o=; b=MYWP88a7NZCpyihMmsv93j6HG2FGPHO+6jSx4RPYP+YvXFEtcluSxyhkhf+COa6/EU 5OxiCUSplYKOxOzbg5rCAUlbhXYEu1yaIO3rurOVR5JoDvRxTSQOAozMuhgq7D4+/9jE AuGfdE4kcR/5z70GLnnDG9P7c/I72YErxjiW+qEHEoHrCuWqDiQokaIJdi+d4xqo1SXL 78g9gdnxV9qklixV0zTLcATIUS5DevAP49OACEb6FcXVVgVPOFvxvG1pcjnPEjHGwvpX PduMFXuBewnrtPx1LgZSzL1FHAeDI6837IQLzq6wQ5TwpcqDGH3Tj/x6n7sTjrXxfxBe CMTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GodJik7Z; 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 h15-20020ac8584f000000b004198fbc2a07si5996878qth.344.2023.10.09.02.49.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:49:43 -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=GodJik7Z; 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 1qpmse-0002Mq-4Y; Mon, 09 Oct 2023 05:48:54 -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 1qpms7-0001wL-Hf for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:24 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpms1-0005yI-1m for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:19 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-99c1c66876aso784349466b.2 for ; Mon, 09 Oct 2023 02:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696844890; x=1697449690; 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=kTqd6Z2Np7lV/f6CqV3RTrP/+37x/Q8ZcMxW6GyXvyM=; b=GodJik7ZZUXsEGY82lt+oEYSiFVxFNOKCvV4q8tJwod13q/JMdvOPc12nalxNN4Fyx nL0keWEOobRHBvnpphfMjLztwsNS83Ku5izhet30jvAuzMsR4Xg7Qs1FrbA9ijL2AeVa Le1a0eesXyF4Ysdrc4Fxf93D4EDc1kJWgiU8WDyC/QHObY3ekwAx2VQBVXjeadHadznY VhHtdH4iUdNqO9QKFKciV0W1uaO2HGPSTw6AxITWLHYqizQmoVyzfhMyYf7VpUaLphXR Stn4UJOfK/Ax8yZ5+2ur6vXP/r2ulMiYOMld0KqgSjYWU/ex+jblQU8mxipgHXnda2ud E57Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696844890; x=1697449690; 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=kTqd6Z2Np7lV/f6CqV3RTrP/+37x/Q8ZcMxW6GyXvyM=; b=XnbgFPMvb3MqCXv1nIwlJMnrQ6/KvDmie7Sc/2BfEjUgq5VkRw4MoELwPe8mcpwKDe lJRSCcn1aXgjFWBkhq60hWQ3XruCUoW9O3Fi5A5fWJSTvJNZ7KiFX6whLljuUrcjCidT T5MqvXdrWZT5VzhCh7rEQX9DcZwn8TMuBVDOTR1umkHhCaYvLNUAw1AkOLE7Z1OFQw0B 25ildHPbZPbKkqYjZ9CDeBpNolENMewoFMgjl6+A1uyuwMwqssCroVl7zb7FzIN1shOS yCFsO79ULSu5hosGCh/wX/YCmQqSDndabuMTCoS3fGw2Q9mRAtnb0g5cFcAGFZTI6IQM jqBQ== X-Gm-Message-State: AOJu0YxyL0Bh0Az+SCLW8A1+Fc0XnAUmOPkdnEgnc1BWG8Euv4YcF4HR yD7/GxEH33QYAlN+RW0CgSDpyHGU8J4DQpu4MgY= X-Received: by 2002:a17:906:8467:b0:9ae:62ec:f4a1 with SMTP id hx7-20020a170906846700b009ae62ecf4a1mr12693439ejc.33.1696844889715; Mon, 09 Oct 2023 02:48:09 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id t27-20020a1709063e5b00b009a168ab6ee2sm6516527eji.164.2023.10.09.02.48.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:48:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Christian Borntraeger , qemu-s390x@nongnu.org, Paolo Bonzini , Ani Sinha , "Michael S. Tsirkin" , Igor Mammedov , Yanan Wang , David Hildenbrand , Eric Farman , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Thomas Huth , Halil Pasic , Gerd Hoffmann , Ilya Leoshkevich Subject: [PATCH 3/6] hw/display/vga: Clean up global variable shadowing Date: Mon, 9 Oct 2023 11:47:43 +0200 Message-ID: <20231009094747.54240-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009094747.54240-1-philmd@linaro.org> References: <20231009094747.54240-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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, T_SPF_TEMPERROR=0.01 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/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 | 2 +- hw/display/vga.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index 7cf0d11201..94949d8a0c 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -157,7 +157,7 @@ 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, +void vga_init(VGACommonState *s, Object *obj, MemoryRegion *io, MemoryRegion *address_space_io, bool init_vga_ports); MemoryRegion *vga_init_io(VGACommonState *s, Object *obj, const MemoryRegionPortio **vga_ports, diff --git a/hw/display/vga.c b/hw/display/vga.c index 37557c3442..bb4cd240ec 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -2304,7 +2304,7 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj, } void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space, - MemoryRegion *address_space_io, bool init_vga_ports) + MemoryRegion *io, bool init_vga_ports) { MemoryRegion *vga_io_memory; const MemoryRegionPortio *vga_ports, *vbe_ports; @@ -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); } } From patchwork Mon Oct 9 09:47:44 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: 730973 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1116288wrw; Mon, 9 Oct 2023 02:51:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBJJuGreCn3Q9/ZOQYBF8o6v5ZZMhNveCV2ccOpY1vs7J2TifBuTnz1QODSt9pu3lR+p7y X-Received: by 2002:a05:6870:b60e:b0:1dd:7fa9:ed67 with SMTP id cm14-20020a056870b60e00b001dd7fa9ed67mr17583939oab.24.1696845085167; Mon, 09 Oct 2023 02:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845085; cv=none; d=google.com; s=arc-20160816; b=oo3+tgB+1xPtifEOAkxSxQSgR4lMqKQaDeAVz+7q50PVUJBncuCyDBOwIlwk6Fz81F FZVuThiO5qctTiGOaa0SohseGRSZF46cIGoeY+bwLhO7E3x28nJTKwQ7s/rbzOQJOClI zebg6A2JjBxYSlT4LE1f1EWdriCIzhxhPMm4m5GdE+gO6DR4Sg9dSwqINIDZZBFXb8V5 LM/fnBmK83ZegA3V9UPNGULAOr0tqGuGSIuW1Wq2sLQ0pR6rk/0N+zGp3byxbY+PT6PS XNEORIOkookYPagD3mSIs98UxxEe+yAZs+QXGJQJjBbNF83wsKpwyM/OOG2g1Eyrv/ES b9Ng== 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=BEGlN++LvrChCTNtyzB8Otj+nJkZt0M6Hyp5n7KviH8=; fh=n4SzPhYKXn8xRxTgdSQ5YZq0XW28GvXJqV224ul7a6o=; b=A5wvIxKZ3BNFtwxVDwkCtrc8v2WoXvG0txQioMh+EzMsjnzpZP/uUwoYj6OnIRPcB2 OSsiv/VC9JXy0EsJaW/4S4HHajbLO7xEJWj6MM0h5QptEpBRwP/yLjlfLgjwA/SCLwl5 W+0DNR53xsdaKNIo3ZIZ4QrF2uFv80+IgZ/uewq5T2ZzKbGzzjY7VJyXn5HKQ7cSfwFo S7/nstuLN1JFnGYVf3euBe4nUtNjDWHjt71GKWA4LBdKWMdny6eLvEJ2Uiewt++N3UY3 qNC6XbRbKm36QiwRpvcftyf8AdUF9wq1o9LHEHL2+8uJz6ZXdzRsFbUUXv3SE4nlXfWM VeRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RShyQl0v; 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 t10-20020a0ca68a000000b0065afd35c75dsi5766372qva.70.2023.10.09.02.51.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:51:25 -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=RShyQl0v; 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 1qpmtI-0003t1-E6; Mon, 09 Oct 2023 05:49:33 -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 1qpms8-0001xw-Qa for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:26 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpms6-0005z9-7d for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:20 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-53627feca49so7161460a12.1 for ; Mon, 09 Oct 2023 02:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696844896; x=1697449696; 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=BEGlN++LvrChCTNtyzB8Otj+nJkZt0M6Hyp5n7KviH8=; b=RShyQl0vPAPDG4mkiGyyGcC/uLFSknFmIiwrFXN2doJJtSmsQSlQXJjTO4xbp/JShI cHQdMs47IvZq8dOZz3iT4sI3HjLQroX+rPhVIaVg+aBxgP2LNCy7uCIe2mswWdTwb+qH YCxPBG1prWu+fxj8NCDe1ce3sSBADo7zSAU0h58LNHiF0pmIr5+Nm3WEcwSAWm0z53KU /R/PCuaHQxe089pNWgTSVFxiHgGuHu8yFEq5ZLluSLBrJVJn73O2PLcUHZg/vS+22q8L n5T2xhd5xYjg3enfMVFC59X9nVvAwvFNQWfn8DDUyuoLW9sCM8HsTZgG+uS0N5Z2rmlf 9OlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696844896; x=1697449696; 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=BEGlN++LvrChCTNtyzB8Otj+nJkZt0M6Hyp5n7KviH8=; b=QJSwDQ+zJ38gdJHXv2OF3fPGsCPPZ9J18N3JiGqSRBUCPF+H1G/ro1F7BSBvuv7A/2 FlH+4gilF74Kxy3E1E+2h3q5rHt44CeGjjFzpDRZAxY7YzZJOAsxlk+3/j6w41XLBdOC cbOnHRqefSazm+DihMKS17Txv46yPZlFA1PfCincJZ8OEyzZgmHCNB6ufiDpPH9S5Tw8 4a+g9SYejASMR5ezDfmJ6Hub7Ki7plqSBWnygu3Ok/bj5BfjttTIJf9M/NesjMNe6T1C HVrvVhePzSaR+xnHbtFu+H0yh6Qq6XUHiC19BjrD4r0jAn5Y1WHCHucihG0fFYy4c1WD N+gg== X-Gm-Message-State: AOJu0YzO+b+YRATxqoQCM5eEuiQ17CgCpIkvIFrxGxdfEBK+EfMXgpuw XrxcrGPPcrqqRwM0LCkW/b77gy7Q1QH4jjthMvk= X-Received: by 2002:a05:6402:351:b0:532:e4d3:df83 with SMTP id r17-20020a056402035100b00532e4d3df83mr12894895edw.4.1696844895949; Mon, 09 Oct 2023 02:48:15 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id bm15-20020a0564020b0f00b005346925a474sm5934082edb.43.2023.10.09.02.48.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:48:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Christian Borntraeger , qemu-s390x@nongnu.org, Paolo Bonzini , Ani Sinha , "Michael S. Tsirkin" , Igor Mammedov , Yanan Wang , David Hildenbrand , Eric Farman , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Thomas Huth , Halil Pasic , Gerd Hoffmann , Ilya Leoshkevich Subject: [PATCH 4/6] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init() Date: Mon, 9 Oct 2023 11:47:44 +0200 Message-ID: <20231009094747.54240-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009094747.54240-1-philmd@linaro.org> References: <20231009094747.54240-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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 Fix: hw/acpi/pcihp.c:499:36: 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é Reviewed-by: Ani Sinha Acked-by: Michael S. Tsirkin --- include/hw/acpi/pcihp.h | 2 +- hw/acpi/pcihp.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h index ef59810c17..ac21a95913 100644 --- a/include/hw/acpi/pcihp.h +++ b/include/hw/acpi/pcihp.h @@ -56,7 +56,7 @@ typedef struct AcpiPciHpState { } AcpiPciHpState; void acpi_pcihp_init(Object *owner, AcpiPciHpState *, PCIBus *root, - MemoryRegion *address_space_io, uint16_t io_base); + MemoryRegion *io, uint16_t io_base); bool acpi_pcihp_is_hotpluggbale_bus(AcpiPciHpState *s, BusState *bus); void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index cdd6f775a1..4f75c873e2 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -496,8 +496,7 @@ static const MemoryRegionOps acpi_pcihp_io_ops = { }; void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus, - MemoryRegion *address_space_io, - uint16_t io_base) + MemoryRegion *io, uint16_t io_base) { s->io_len = ACPI_PCIHP_SIZE; s->io_base = io_base; @@ -506,7 +505,7 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus, memory_region_init_io(&s->io, owner, &acpi_pcihp_io_ops, s, "acpi-pci-hotplug", s->io_len); - memory_region_add_subregion(address_space_io, s->io_base, &s->io); + memory_region_add_subregion(io, s->io_base, &s->io); object_property_add_uint16_ptr(owner, ACPI_PCIHP_IO_BASE_PROP, &s->io_base, OBJ_PROP_FLAG_READ); From patchwork Mon Oct 9 09:47: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: 730970 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1116203wrw; Mon, 9 Oct 2023 02:51:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjKRfyTHec0akoGuXXBHjTFn6ZREsy7BqoF4TcC67LJykYKOoPawKIXiYpObsQDwW3CmgK X-Received: by 2002:ae9:e504:0:b0:76f:98c:3f0e with SMTP id w4-20020ae9e504000000b0076f098c3f0emr12549891qkf.68.1696845063036; Mon, 09 Oct 2023 02:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845063; cv=none; d=google.com; s=arc-20160816; b=HtX2vrsxLVgDmVslNh/44bEirx0ZqMT9FRFRP3x+Cq3raVnGRvBc1kjLbkh1HH4S7B jDzYw4FCyaQ+vWDqQ4eHT8i9y8SUaACguFqExF7FHOD92We/mBb5G+l6VeIAn6pasydl uZlfF2k/3RcKkSd/twtXjoZHdIcfeqd4SY55IFM5lFSg30O/dIvCKvWh7E1T6Vv6/292 JHHRSYtPx6hrr8zM34LAALPjd3IIFwch5AcQWXztDKtHw0ej6tl6gy0EHVN2CZ0qWAqb bsk11lNOzSvCaeI3hTDYN0lh/8FCXexMXh7uzvUZT+fvQv+5jCOL0oB/SGOgHj5w5PR6 Op8g== 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=6g+UtAuD0hn4kXVa1P2Z0NMjoM/q10pvTRR7Cvby2qs=; fh=n4SzPhYKXn8xRxTgdSQ5YZq0XW28GvXJqV224ul7a6o=; b=A+Qgo3vV8gcUnNrGRQ5yED30FLYYuKApl6LJ8DwW8I3qqVFCHAhA4oC9+cKZAtsVkL 6pJ4/VypLr7hiHqdT4yFmpdGPf3GmyeitcJNn8cIu5wHoivwzPZ4wpeE23nXY3bxU5oI Q24hdI/yAfI+UeUw1tVt03JV/xeH/BE0QCPQqQt1jDho+IcQrXiDOARDtt3nHDPCkuam lNjkBrU8b/l1XBfjmjp9CY/Od71KZbHz1Qx1S8Tt/shjRSsxK0lhCIq5gzpVukGpFoPM BUOWguE08YKEcMPoFeTdQBnKIKd6ZTcWDAYTTqEZ5oCcpNk+ctVnzxDJi3RfxSnrM1ku nFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yJ1R9jO8; 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 x1-20020a05620a448100b007759025c185si6034463qkp.525.2023.10.09.02.51.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:51:03 -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=yJ1R9jO8; 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 1qpmtC-0003Mm-Pb; Mon, 09 Oct 2023 05:49:27 -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 1qpmsI-00020u-0G for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:35 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpmsE-0005zy-CW for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:29 -0400 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-538575a38ffso7036266a12.1 for ; Mon, 09 Oct 2023 02:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696844902; x=1697449702; 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=6g+UtAuD0hn4kXVa1P2Z0NMjoM/q10pvTRR7Cvby2qs=; b=yJ1R9jO8t++tvLIFJ98ns3Xx95BRh4AqQE9yr2wKo35pbKD7aEQyAP69/eC8FWCXFW yAyFWjcBIbGGcdRzsNL2RJOpunKZUZgnNcy1M+7aHPxhACLT+7OEs9ttiWX6Gqbg/CX7 i4jZLyF6M0eEEo609NhnrWwyi2ZIc39fHSu1emmTBln4fuVFw5sUsz45YVYodWnIdg07 yAVel2eV271/0liKZa/7wuk805a41JJqahP1GQTpG5NonZ09C7gV6WATS4Axc1F4EnR4 6k+Rw1UhfiFu7D3S/Fqjyxs3+WeZy7CmeeFuJFgGVh901L+rFs/8RgVOPWNZBPQ+QMGO ZlxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696844902; x=1697449702; 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=6g+UtAuD0hn4kXVa1P2Z0NMjoM/q10pvTRR7Cvby2qs=; b=YAwm79rEKUJSFmT/srIEWUVQlnb8c6vsmmm6ZNDfQOl++WokZzHa4gFlqJTcSuIGrm oDCXhzmR7SfHPnYt01diXzrHvIw8478YbL7vfOPSv7gz52BnAp+Egtm8XnenKWkwDHPC 1O38O1NNDb8Ok87KXyi7AVMzJX15LgXK4/w5SZyntEZMxA7djS30NUZMj8VNP2owaf/j 2xPuEx7ETI7m1jfLF4EjbWDWt29INb53mZK+ZDdgpuTlfhdtrUtXsODL/HKa8JfbBMq8 2Bvx3+pVHtOS18DJMnVVx3p/v+ZIBt+TqWtb4M/Jw2vScxCxh1SmAmA18Ew9gJeqjXUd b+JA== X-Gm-Message-State: AOJu0YyUS2bW+d5L7Xn5Yt6AREaeWJvL9DO8lDZlXXMVQMXHGMd8Ls7R +XLDS0JNQyILAQ+HwWxRTw6cYFwAGMIsvLmA778= X-Received: by 2002:a17:907:2cf6:b0:9ba:1d08:ad4a with SMTP id hz22-20020a1709072cf600b009ba1d08ad4amr2491208ejc.29.1696844902291; Mon, 09 Oct 2023 02:48:22 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id i11-20020a170906a28b00b009737b8d47b6sm6499905ejz.203.2023.10.09.02.48.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:48:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Christian Borntraeger , qemu-s390x@nongnu.org, Paolo Bonzini , Ani Sinha , "Michael S. Tsirkin" , Igor Mammedov , Yanan Wang , David Hildenbrand , Eric Farman , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Thomas Huth , Halil Pasic , Gerd Hoffmann , Ilya Leoshkevich Subject: [PATCH 5/6] hw/pci: Clean up global variable shadowing of address_space_io variable Date: Mon, 9 Oct 2023 11:47:45 +0200 Message-ID: <20231009094747.54240-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009094747.54240-1-philmd@linaro.org> References: <20231009094747.54240-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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 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é Reviewed-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; From patchwork Mon Oct 9 09:47:46 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: 730968 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1116178wrw; Mon, 9 Oct 2023 02:50:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtcyBvjfDdwYIrcowSdbfTAzExA5wHUHzxupHedx8dsdBZ+lQt7yMWDrvk/ISZSJdB1q55 X-Received: by 2002:a05:6870:7010:b0:1c0:5f7a:896f with SMTP id u16-20020a056870701000b001c05f7a896fmr17292330oae.8.1696845059277; Mon, 09 Oct 2023 02:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696845059; cv=none; d=google.com; s=arc-20160816; b=MHX2omgp5WV8by1WCwX57Tk3a0aW2btpymJTBRUM60wqGeACldhRtimzVUFDNh4OP5 7OzzWcCxsGsCaUZQx9R/VLca8KMimboM6qRa3LL5Xpva6fanybBhlrtLZeRi6fUPrfJP ZsYHoUFp/BM382LYUPsqV4LJwIxSm8JCzEE1vhA4G5KoMD2pO81HA36cTAnUja09a5Mx n+x9+VfEHXySCVaK+W1yYIjkAA+gz04m4yECmGgjsT/fvmX1ac5oLjJsQ+sLXfBn6ym+ G4+4xyZvG7vmQVWRtF4w7WZxWqKquoReHReJlP3j2D2Wougk83JXsIEct5QQnm/A+/rV thog== 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=pMMxlES9nAQ+sONyZQnmh1EZ23km32jDSkIWikw2cps=; fh=n4SzPhYKXn8xRxTgdSQ5YZq0XW28GvXJqV224ul7a6o=; b=FiSyRkaTS3hviKizB/O6PX/VDjiajPkpENxKvkqGqvmz7lZKOvnV86bWtwESTszTIb M2gb9tBejUO9AefiAl8MCu5ZayBFvO34Dz4y4zPCgDWqtsgZ3S2DZh3rmmsssTk8mRlt 5F2vE3UNO9uFyZATxe0sGRnMa9RD5P7gPov/5xLRvNRr+dKeTzcZj8tCsdmDS+PvRQrV ycnTaAQQcYa7rtRaCPUCg2/cJlfMRStSHQp9sC01pQhH8Qd+g1QHvhMi3W6p1CN7jKsf +RXqz3nuQE+Njpqgp34n11N/jGivZaP+8HwHi5HzIFhT7fdPXrAcWm/Vips4ksWkmgdB uIxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UEEaVzD0; 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 ro17-20020a05620a399100b00770e0f570f8si5806468qkn.442.2023.10.09.02.50.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:50:59 -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=UEEaVzD0; 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 1qpmt6-000332-HJ; Mon, 09 Oct 2023 05:49:21 -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 1qpmsL-000246-A1 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:36 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpmsI-00060a-Fb for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:48:32 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5334d78c5f6so7426948a12.2 for ; Mon, 09 Oct 2023 02:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696844908; x=1697449708; 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=pMMxlES9nAQ+sONyZQnmh1EZ23km32jDSkIWikw2cps=; b=UEEaVzD07CeGQ7jVjLoP2R9Tg/6ON/l5f4TGcenBCSbzShSkbqD4FGANhF5LmRlvl+ hVRzZXPr71BqvZoojL7dS+AktUMZc1fxsXY2pp4/JuHZOjIiDVdzK2UNbV2FFl3bHi8y 4hooNcQuByZDSvgzkt6GFKYW4lvOxJ4XIBuFPVJ+ydh/0vivtfsmpMI4d09PzXKcaMaI nOFiFJTT7BetbSkdwycsWcpSY+gUjUiCBikWdGTn8wpGpzUFQcPd634RX/P6Vfo6qWvh 8dNFwe70lqZrqmjgH9JTkMxqT/Luu6a3PYWkP+oAkZDOhVtP48/DDWmQMuXmXJ1acg/9 1fzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696844908; x=1697449708; 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=pMMxlES9nAQ+sONyZQnmh1EZ23km32jDSkIWikw2cps=; b=dPLUdkP1znb5m/Eu5ZQTzcYZN3kCfzynfNM5VmrAL0QwxJae7ag+Mpv9Df4HcMZDn4 X5zupUHvO1tNCe2Uz9kwbjr0uVgXNwy9vYA6/8qW4n1kXeugKJwVrpBK+LRhTHpYwlLe dw61xtinrvZu4krFVg29T7IAiulCi7TB8qFUZFKcXMxCbM8tsRilNAswLdRpjWh9nLEn WXLCTNbziYiD/dOZCh5i9J7iWRV8Y7C1GSKluDV/NyZk12E7eJrbujkZJYNQPu9n/o90 c0y7H5vNgyQhGtzlOrHERe3kAdRRj6tgLn2SkXrAXGRxtIsk09UV3vSQNC4SJ3eUUNQ7 YuSA== X-Gm-Message-State: AOJu0YyJd9Fg1lauGow/aIXvXbPnY7p0nfOyYcLxUUblczagqBn2aCN5 oqz4HkFPQK4A/QfHai1Pf8xG0pO0oDv6vxt6ueg= X-Received: by 2002:a05:6402:1b0b:b0:527:3a95:5bea with SMTP id by11-20020a0564021b0b00b005273a955beamr12741105edb.32.1696844908700; Mon, 09 Oct 2023 02:48:28 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id d5-20020aa7ce05000000b005346a263bb1sm5831257edv.63.2023.10.09.02.48.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:48:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Christian Borntraeger , qemu-s390x@nongnu.org, Paolo Bonzini , Ani Sinha , "Michael S. Tsirkin" , Igor Mammedov , Yanan Wang , David Hildenbrand , Eric Farman , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Thomas Huth , Halil Pasic , Gerd Hoffmann , Ilya Leoshkevich Subject: [PATCH 6/6] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req() Date: Mon, 9 Oct 2023 11:47:46 +0200 Message-ID: <20231009094747.54240-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009094747.54240-1-philmd@linaro.org> References: <20231009094747.54240-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.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/s390x/sclpquiesce.c:90:22: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QuiesceNotifier *qn = container_of(n, QuiesceNotifier, notifier); ^ hw/s390x/sclpquiesce.c:86:3: note: previous declaration is here } qn; ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand Reviewed-by: Eric Farman --- hw/s390x/sclpquiesce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c index ce07b16884..a641089929 100644 --- a/hw/s390x/sclpquiesce.c +++ b/hw/s390x/sclpquiesce.c @@ -78,12 +78,10 @@ static const VMStateDescription vmstate_sclpquiesce = { } }; -typedef struct QuiesceNotifier QuiesceNotifier; - -static struct QuiesceNotifier { +typedef struct QuiesceNotifier { Notifier notifier; SCLPEvent *event; -} qn; +} QuiesceNotifier; static void quiesce_powerdown_req(Notifier *n, void *opaque) { @@ -97,6 +95,8 @@ static void quiesce_powerdown_req(Notifier *n, void *opaque) static int quiesce_init(SCLPEvent *event) { + static QuiesceNotifier qn; + qn.notifier.notify = quiesce_powerdown_req; qn.event = event;