From patchwork Tue Oct 10 11:50: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: 731450 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1701271wrw; Tue, 10 Oct 2023 04:51:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH32vfTQ54woO5Xop8ufZNieIP9fodJpAqlwkRGpgyuK6hFIG5+Tlq97+a2ZtFsRaxLEhGQ X-Received: by 2002:a05:6102:3c7:b0:44d:4b34:af92 with SMTP id n7-20020a05610203c700b0044d4b34af92mr15581693vsq.7.1696938677023; Tue, 10 Oct 2023 04:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696938677; cv=none; d=google.com; s=arc-20160816; b=iJ+YxQqz8xrV1qyCc/OsLUMvr1WfysbK0BiHanogkV0pQAYWySVepUXFgFIvPWAbIj xJzmIwDBBlJQXtIdPmXrRdYokwSgBlOnTi3WB9suCRt7qDpZRs8bRwyiiX4lWx7vlBND 2LtNJHxfIoiF27zk7BIYXdhdTEV8PixWvn8wVzw+y3O16f35TGiBqPJUieg3LcVBtWfz JWi4Bg2l8cC2k4jxgATP9vNn1lbi7Rfpi84DcNFbIkdJoUWVdBNCKBrhaUMgzMt2e11e Q03hB2sxZMcvBmQG3ANs7f5Aqwd4Rw83OXFpujrgPXYoTrrI+Rq5qWKEKb64S2jENgOj WlPQ== 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=06c1SfXCDJsZD94qIZFbVOXNxhn2+zM3SMxozUzqBSg=; b=styTjydq19JSUqP92unLWU+G7qwRdjnl+/ZQ+gj8jPnJeB5UhYMjUewWyRwinYv6WH 7HHAf0Em75DeHYOw6AFrwyUf+isvwZG9Cyd+Y4IOSXGorcWKyuxNq5lmZ0ZHj6EL5qOl ByOK7kZDCPP+aB6cRU6lNbR6YbW1KS/EpmbM/dYJOsaw5qwV2HU2igv0zmeJIzK/EcKg lV0ZK5DTzpLM0kGl8J0Cp/qoSZemeNo3BCHK87iFcSOLKaEF7k7GzQIpt6JRZM5emKEb eIeLZaB59ZU/XQ5gciUdwTBhjdM1zaONMCdI1mAQV76KUSZ11RcmjldI5tz1F20HDbKX jZzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PTN8CrEg; 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 qk16-20020a05620a889000b00775cf5ea68fsi7253297qkn.65.2023.10.10.04.51.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 04:51:17 -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=PTN8CrEg; 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-0007d6-N4; Tue, 10 Oct 2023 07:51:04 -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 1qqBGQ-0007cJ-SJ for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:02 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqBGP-0006zb-6Z for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:02 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9b29186e20aso946382466b.2 for ; Tue, 10 Oct 2023 04:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696938658; x=1697543458; 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=PTN8CrEgNmZbn0FxKhcLr8Og2Rz6umyv/CdW2JLE6ksbqTH8qU3L2Is4lJACUq2e64 HXo2sX18nnzZg7a7qV07ZLaRZL0BJc4a8eNUzJS3Y9Bzs28G7UC0VK5Q96QSwRwdoDjZ Hio6x8t09M8AgBuyTBuNqdKLT76vs2VdD+1K4r5qGLJi4vZQ6E2Y6Msfx7pNBA3G5v9H ZzqbmXXgM1HLu0So9duhiSo2jtpm6ISYNJ3tWbW6naFCPBUDhkEn24okQFoi1QlasPQG T92s82c1dEL5cKK6hEq0xLJTMqq3IMlYk2INHOUK/s29v/7dNRWkXORL6ksYuxu//n4l wvAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696938658; x=1697543458; 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=oG3P//0Srb9AEnw+y/mYPAOS/IeZuHu50hBZKF3AVK6jm/lJ6PTUNPSD/9KmhCc5Xy VJK+W25aHgkOqycZ9d48VQOjNxS6o4P9IjgfFyUjhbg1qWFzn24Rtvv6Z9tbb1F139IU VeEX+EgeMiNwul2ob/GROpGh7ufqro48RFFCiPkgGgmgJUyNOt0tHQ6LgiQmYZrym0Vt o9lDJXATLzkQbm4qzZyCaop531NzVqEyox/jYfHujBpCcYxpKkPadGMMQsiLT1GoWVdT xxXFFlW6TM4QCf856SZbHaXU72zAH9X/6OL72dtI2yO6qp+tqY2I1GxVJEYn9Hxk8F3e it2w== X-Gm-Message-State: AOJu0YyOtVUITu73c+1+TTbhNJZTMfSY+AbYi/nCwTCrX5EclXec6XIK auX8kBtSO/S97lfsm+DbWBRQGIaLF5GmlUY9lEJLLA== X-Received: by 2002:a17:906:738f:b0:9ba:14a3:7221 with SMTP id f15-20020a170906738f00b009ba14a37221mr5684027ejl.73.1696938658458; Tue, 10 Oct 2023 04:50:58 -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 i13-20020a056402054d00b005231e3d89efsm7543598edx.31.2023.10.10.04.50.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 04:50:58 -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 1/6] hw/core/cpu: Clean up global variable shadowing Date: Tue, 10 Oct 2023 13:50:43 +0200 Message-ID: <20231010115048.11856-2-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::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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é Reviewed-by: Ani Sinha --- 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 Tue Oct 10 11:50: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: 731452 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1701522wrw; Tue, 10 Oct 2023 04:51:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeC5UQLZKfXJLsgq/zDJOhnjVCyscDSl8HyWI2G0ZSPrIsVxuMQrz9s+MwpWLf77ei/l07 X-Received: by 2002:a0c:aa5b:0:b0:63c:fa7d:74ee with SMTP id e27-20020a0caa5b000000b0063cfa7d74eemr18004858qvb.50.1696938713520; Tue, 10 Oct 2023 04:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696938713; cv=none; d=google.com; s=arc-20160816; b=x6+1AZHpzk8gscWzQTyqTcBK69uPQ8r1Y3onMcd3vjO5HkvPfBtokC+2xIcL82w0FU jO99gcqUBNB6ly1l0bdFrJmRvZLhxTzZqQ7EDp3qLiCHUFyxPX4tZS68S9XbcO61AINC 3wVtyFE3k9dRprOK7GeMTg1q8k7XItHxP+FsX5UBWnCntpTPAlCUzXZD6wzIfextUIhx YRKv/gBe4u4Z/Cbhh09Dfn6H8nFxz9WM/WTswvBsAfR9hH/dBGhFadUX/bzMl67wv4u2 2MHJiuJA7yjYJznXJPWAFrRtfjw7lRC2IxstDvVeTRwVIu5fPMT2vHKN5aGfkYRIgjbG WeMA== 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=fiFld9bySWpL5X2cOy1s/AgFftSvZ7+zCb8U4NbScok=; fh=06c1SfXCDJsZD94qIZFbVOXNxhn2+zM3SMxozUzqBSg=; b=cf897xSr6FKj6PgcA3Uat8cESYjTwKYetwE3zpfDlEefWhAc1PiKbnnu+n3Op96Ijx al1RWtxLAA9OqFF1yOEFfQh/2l0XU5GGZ1mPfTo1Xl3ROp0Mt9llAvz/7m9UgnPHvKYz konmw/HHdIi/iAf8n86Lvd8dAuGUYFl3ykR2evqoxOKr8usbSA7djLm2cj44xd4h280E NsFbAibHc/QU4tXs5dEmAZUhpkYX/pAnOrHSZOJ0WstI9PHKTncdFM74uc/z9TkAOuGA InHxb1RLMl+uuYTgXbbEZZ6B++wf/ydzuerRYZMEvM7izWS8RASVR953eBc+nRsnxRzg uaeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pc8dWaRY; 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 g17-20020a0ce4d1000000b0065305aa036fsi7553036qvm.373.2023.10.10.04.51.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 04:51:53 -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=Pc8dWaRY; 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 1qqBGY-0007gs-6e; Tue, 10 Oct 2023 07:51:10 -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 1qqBGW-0007eF-1n for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:08 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqBGU-000712-AQ for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:07 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9a6190af24aso964704166b.0 for ; Tue, 10 Oct 2023 04:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696938664; x=1697543464; 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=fiFld9bySWpL5X2cOy1s/AgFftSvZ7+zCb8U4NbScok=; b=Pc8dWaRYE5E76Jadq9wA5Nh0HD+6NaWNNU+5xhi284baMb3cpdrxC52qkfhETXQJ7A ecYhwwCoW4bA+mHmdmC0m8eBNblRaDyuvoaCSF9R20tY/S9qIQ3hlkX5eW/qhNkjdhsH 3p2anLIaElkZAlpETUrnsR6PkKCvFnSwKxHXuAwJX5cFv+YX+ya0IJl270Jd8DqumAe4 ZjE3HvseTb1RK/pNxisHz5rjEDXwUH48yLBLGQo5oxuiaRxgOFKxTyrg7bQXhwWBXaVY auE7XxON7daTk8ynRob5YlSWHFJCNHnakDn3pDk3yTpOJrza0bLGXuw/GoUausPmNgu+ iBrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696938664; x=1697543464; 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=fiFld9bySWpL5X2cOy1s/AgFftSvZ7+zCb8U4NbScok=; b=HU/3W6u/nOm37jMTSHvDExHNjJ/FCHVeOHLh6VwQhk/5L+b9u6xv7AOUNa0W/AJN+7 yyxPLT1d3ymodFWg6mc5Md+L8EMysiOTsr4kydZCmgyj85EEyDuCBb4Yx4p/b7psu4iM xmPN+IicREN74hIzpnocTqA7syhDQrl4WAuUQlmr1Z0wkKqDLoym3bMNCSiFfe6SPMkQ +s1GzS7D/W+4j5/GNanuA/gvDJxXh9CuGuE1tlgqeJ9uT1Cz1/tTD/7Tb6idqXXHaxX9 P3/7/NacdQwCHBf+iTy6mBvQc21lS6w5S+jjI9/zHH9fG5bjvPoTHYNfCgho3SljQXRm xVbw== X-Gm-Message-State: AOJu0Yz5WQdBW8iYt52JEW5emRjdnym7agPC4sfQ7XexoAPrRompKZiI WZ+85HYRmW80HIO5ZAZfIkYm8grjhqOGfLEg/9Op+g== X-Received: by 2002:a17:907:7850:b0:9ae:75dc:4589 with SMTP id lb16-20020a170907785000b009ae75dc4589mr17988299ejc.64.1696938664748; Tue, 10 Oct 2023 04:51:04 -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 u13-20020a1709060b0d00b009ad87d1be17sm8323271ejg.22.2023.10.10.04.51.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 04:51:04 -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 2/6] hw/loader: Clean up global variable shadowing in rom_add_file() Date: Tue, 10 Oct 2023 13:50:44 +0200 Message-ID: <20231010115048.11856-3-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::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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 Invert 'option_rom' logic and rename it as 'option_rom_has_mr' to 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é Reviewed-by: Ani Sinha --- include/hw/loader.h | 11 ++++++----- hw/core/loader.c | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/hw/loader.h b/include/hw/loader.h index c4c14170ea..9dbb9f7fdb 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -272,7 +272,8 @@ 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 option_rom_has_mr, + 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, @@ -341,15 +342,15 @@ void *rom_ptr_for_as(AddressSpace *as, hwaddr addr, size_t size); void hmp_info_roms(Monitor *mon, const QDict *qdict); #define rom_add_file_fixed(_f, _a, _i) \ - rom_add_file(_f, NULL, _a, _i, false, NULL, NULL) + rom_add_file(_f, NULL, _a, _i, true, NULL, NULL) #define rom_add_blob_fixed(_f, _b, _l, _a) \ rom_add_blob(_f, _b, _l, _l, _a, NULL, NULL, NULL, NULL, true) #define rom_add_file_mr(_f, _mr, _i) \ - rom_add_file(_f, NULL, 0, _i, false, _mr, NULL) + rom_add_file(_f, NULL, 0, _i, true, _mr, NULL) #define rom_add_file_as(_f, _as, _i) \ - rom_add_file(_f, NULL, 0, _i, false, NULL, _as) + rom_add_file(_f, NULL, 0, _i, true, NULL, _as) #define rom_add_file_fixed_as(_f, _a, _i, _as) \ - rom_add_file(_f, NULL, _a, _i, false, NULL, _as) + rom_add_file(_f, NULL, _a, _i, true, NULL, _as) #define rom_add_blob_fixed_as(_f, _b, _l, _a, _as) \ rom_add_blob(_f, _b, _l, _l, _a, NULL, NULL, NULL, _as, true) diff --git a/hw/core/loader.c b/hw/core/loader.c index 4dd5a71fb7..f0d20fd776 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1070,8 +1070,8 @@ 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, - AddressSpace *as) + bool option_rom_has_mr, + MemoryRegion *mr, AddressSpace *as) { MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); Rom *rom; @@ -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 ((option_rom_has_mr || mc->option_rom_has_mr) && mc->rom_file_has_mr) { data = rom_set_mr(rom, OBJECT(fw_cfg), devpath, true); } else { data = rom->data; @@ -1239,12 +1239,12 @@ int rom_add_elf_program(const char *name, GMappedFile *mapped_file, void *data, ssize_t rom_add_vga(const char *file) { - return rom_add_file(file, "vgaroms", 0, -1, true, NULL, NULL); + return rom_add_file(file, "vgaroms", 0, -1, false, NULL, NULL); } ssize_t rom_add_option(const char *file, int32_t bootindex) { - return rom_add_file(file, "genroms", 0, bootindex, true, NULL, NULL); + return rom_add_file(file, "genroms", 0, bootindex, false, NULL, NULL); } static void rom_reset(void *unused) 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); } } From patchwork Tue Oct 10 11:50: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: 731451 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1701501wrw; Tue, 10 Oct 2023 04:51:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsi5bSLo7MLPqKW815uS+545/OFB0Q92k4suJXPCxgLYag+XhiuS8PjVWx60savkKnbhvj X-Received: by 2002:a25:dbc4:0:b0:d7e:8642:f0b0 with SMTP id g187-20020a25dbc4000000b00d7e8642f0b0mr17926879ybf.3.1696938710796; Tue, 10 Oct 2023 04:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696938710; cv=none; d=google.com; s=arc-20160816; b=G0RoRLQfW1cPg+juSnyl4u/qAEw6ZI2cmJYnPd3UMPnaZuVi0SqtYuOgeuQ2vTVyE7 kkbHuOxzABGj1dQsDXsFHkEUIzlBQsU4zkcwiZgkvEl7TmqZ8VnoQdnxdwozohsRPJbm 7qVQUZaFWcKe2OJjx1MqkMAr+96moDNQ4a59MS1MYBA64RqFNieJI3fNXPm4+Gc/oJq6 Un57e4t5rS9nLTqBFDej9iMo/YEahWSiPG9/k/7x6p9Wuh8zcJ5O+ajRalxnKGuT/HNi 8tvPByp8qOqr96Hvy4hsS5fbnRHOcR+kkrJjqrWxJyHB2T9mxKshSzZe5+FT0wSSwSgx YzPA== 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=DLUjh+Qx8MrulfYzvPkIHnb5yPwNt/v/tfPLH7EDgjM=; fh=06c1SfXCDJsZD94qIZFbVOXNxhn2+zM3SMxozUzqBSg=; b=wKm+ihSiBcq+XmVaIErZPZ9X2pvg+a76/lsvV8X6vsfgDvEgQ0PW4AQ/HvYeCuyGzE DMCzq4khplPLqR6k2UYcu3JCvlvcDuEfafqka9KJmvQAlM/vgnvA4c6MSj6ogVZScAWo Zx/e2IP8lemoASZ6DJRIS9aQcQetZEVoXFrJM5u3YJcfqkHwLHQsaSWsvLWbS/fEdezE 6f817AYyGdPKjWounf4GlqxZNLqlNJLD4RyxlkNLMrQUrtB9t7XrR1ySMFZ8d8+wxWWD Ez4pVhoTFKWFWQS88jK/D0HFHCk7e68MvV1sRJvslVdIIqXrqcCE6VJ3lFzxZsaq3qUl dHDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pi4zl7Vi; 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 w5-20020a05620a424500b0077701e9f740si4989611qko.775.2023.10.10.04.51.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 04:51:50 -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=Pi4zl7Vi; 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 1qqBGn-00082Z-3W; Tue, 10 Oct 2023 07:51: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 1qqBGl-0007zi-5n for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:23 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqBGh-000756-4g for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:22 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53b32dca0bfso8546489a12.0 for ; Tue, 10 Oct 2023 04:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696938677; x=1697543477; 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=DLUjh+Qx8MrulfYzvPkIHnb5yPwNt/v/tfPLH7EDgjM=; b=Pi4zl7ViF5ITYdQXmFBTH5LGteyeQUIObBvcIqV6ONYgkIYK1JEbcMw9RE9Umbcq9x o8G+iQMshstxTfgXRGRmuWv8J1NSAstKHpL4k0e5nEBWG2Xq17P5HXMaO1um2+XZeJGg 5mG+S8sM7ioNM3A/nWf0kI0aiJxL8JCalo1vA8Jk6k+5pq/UI3kLzkU+nebjpj2SHXsX P1vR3B8TSfY1q58X8sDOfhCAXzMzJLtygD/etTlxlQM4d9ogRo1bz+Y6dVq5Ofs8POOj tB1dzrO02CRw/C6IouVM46pS5CMnqjIvawhf5UqpldmxsyfG9sMfK5r0KEWU4FfVdaZ4 b8QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696938677; x=1697543477; 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=DLUjh+Qx8MrulfYzvPkIHnb5yPwNt/v/tfPLH7EDgjM=; b=WYqDbLGrkQYNcaEHGeew6/TnT8XRphOLKcaGw7/3Q30G9oy6w6CYX1sxZVysFNe1oK ai4tAN/oTBjdpZAHATcatXac13/ekULs1zeG3+d8COZfK1OJg9BvQ/Ls/z1/gU7DIgZE XQu2kfv5FLshvwARFxEr+SBB5yyGofontfsPqnsX4FQbXAmH3pVZSxXoQP+xzGxXGa31 c4iEpSFcp6UPxN5ZyXtsuXxuYDQNCC1vA58pWphhwTWLBMaP3fYIRtP6OxjhJyL78Q7c j/GjZhJXf92u5tdG0hd8+toAGzXlwxYCEZ5OXjNVJkW4kd4cLtqVjhowjz1JO6jD7wE9 hqKA== X-Gm-Message-State: AOJu0YwOTRb4vpTlTOrTtQfPObSOBTFP9Wo+lra6bPdBHlo7L/qLayS1 7RAJ+j9D36RT1SoQKBOwxC/Aie9nOyF+MI3DOqHY3w== X-Received: by 2002:aa7:dcc7:0:b0:522:b876:9ef5 with SMTP id w7-20020aa7dcc7000000b00522b8769ef5mr14362256edu.8.1696938677099; Tue, 10 Oct 2023 04:51:17 -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 bf14-20020a0564021a4e00b005362bcc089csm7382182edb.67.2023.10.10.04.51.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 04:51:16 -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 4/6] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init() Date: Tue, 10 Oct 2023 13:50:46 +0200 Message-ID: <20231010115048.11856-5-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::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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 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; From patchwork Tue Oct 10 11:50:48 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: 731455 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1701839wrw; Tue, 10 Oct 2023 04:52:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPinRLllpwOL46+cTJIYUossNbf7XdhMNMpiXtMcLpipk2HsUK6Jl1wf/ZLU+WWEw77FJH X-Received: by 2002:ac8:5f8c:0:b0:417:9431:c61b with SMTP id j12-20020ac85f8c000000b004179431c61bmr22443074qta.18.1696938758358; Tue, 10 Oct 2023 04:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696938758; cv=none; d=google.com; s=arc-20160816; b=m9X9t3bPEKYorkGwPITZtuW8ksWW/HHQUckT2ho4kPqQQgax93zosnX3a5nPiTDM85 v0q+Lli+ExRpMQEgfLpfG4tp9vbB7jEl5RlbSEE14+IcezEK9u3Kp2oFrLpgHPEAQQ6V T21EBRvHHtufkzXgOfEhH7rWPr5Fl0l1hvgY6TD2uxfd85pGjge1cJ3lzkSA1vfy7jka lEUZ2qRtAu/WP4nLkeytKkVO0Z3NbHj8bLDZKETlElA4Sw1uAzXVGqLoB7JVO470ePUT t0dxzaXdAbVZEEEb30RXdZ4QtdQPy8x+ZHuomZoBEosK4vhoiVqQxp8Pq4hs3N9yDrKx 9opg== 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=mxNNJ0+CbtGu/FtriJHh3KhiymL+ByyxtOGep+z6Z6E=; fh=06c1SfXCDJsZD94qIZFbVOXNxhn2+zM3SMxozUzqBSg=; b=g4ioG1xJ0lnjEIaZ1E9ye7Ll65MFoZRzPMLNkim45iTiiuFhJBG6e02TiXAh92U6jy C1oKP37uU4gXK0KQyNeX6NAfPA73BO4F6l4KoKW1BQGK6SUDwwWzqRhRK0vSLWRIRX27 YpCg6BWjn6SGNx/Lmdn6UZ0uODgj2nnFP5MHqnvqsinnNz4T4AeGfkV1I4xvOdpBnBme MhcYjuP2hv8u7SEjFmFwf9TXSV3RHyViKMbaJRsloK+Ig+Qz15B9B32BA2x0DAXy6Uu/ uQnbhoSy+7S+/Y9l1qxN8HVGKbZvKRXpw/Ct2YpCuUL+0TZvXmvmsJwrcWoJ4Qzj0CMT 3Cuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cll0BMja; 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 m13-20020ac85b0d000000b00418135e539fsi7617658qtw.359.2023.10.10.04.52.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2023 04:52:38 -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=Cll0BMja; 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 1qqBGy-0000IP-7U; Tue, 10 Oct 2023 07:51:36 -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 1qqBGv-0000Bp-B8 for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:33 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqBGt-00078K-Mo for qemu-devel@nongnu.org; Tue, 10 Oct 2023 07:51:33 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9b275afb6abso1450779266b.1 for ; Tue, 10 Oct 2023 04:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696938689; x=1697543489; 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=mxNNJ0+CbtGu/FtriJHh3KhiymL+ByyxtOGep+z6Z6E=; b=Cll0BMjaaF+NkJ4dA1sOKeOd6F7VATNi+FbkbuxmL0kCcNHdjWk1n69rpjlQqNQLEp tSVrQFuBtM8cWhHEaJ5abF1HiUp+mn+VrT3ygqydR92if9vcMwaFeE2RXdn2cBzd3T7y S3vAbKNSz3mJB29D70TpcYl5f1WIAutKHRab5GwYxXGOHT5+KljcwGEG9C780XQZoDnV me8pjRyxYDhpotL2k4g2173xTLrpwgt+V9HFU3OOOWsF1V7ssGqVi3TW4IyzOkF3d8MP IkggRsS7A9otiFc6g4UCa8AqMa9ZkMSrb19khFD47/jz/ePWQnFMM8D9eBFSGcu6cRBe mT1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696938689; x=1697543489; 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=mxNNJ0+CbtGu/FtriJHh3KhiymL+ByyxtOGep+z6Z6E=; b=Vyh6hOZ1lagRgdFlTCwNd6vCU9c92We3XEzNBAigTAtpjOnPlWCfMDSu/e4jsGMXMR eKvpT2baix/mWPgu43O2iM69ZotkJc4OG0hOUjyPU9Sc8l2yGPqkbyvqf4W9GAlCEDxE JuFsZ45IndJ5wW3gkw6smUFtXlXqKE7E39cpPwt+EUPKTkrDGwZ7d4lNb2umQI7Q31YI o/lCfDf4kG8Tdio/lJeaxPPxU8spyG4eFjtXNZNrywyKg478Oeq+Ke1kvbWePxXe4qBp NDfZr3beLLOKz3b4/UP3HaBG6+PPMpLOrZmfXb/XE6JW3LbdomRvJ5NV6D25SmEGTBgC hp0w== X-Gm-Message-State: AOJu0YwmBgglJfdrPolHSAKiWf90IrVjpWtKYuLv5HEusvdHuz5nIQZl kFqTOBm9PhkLPEMLY2cSxH8is+b3aBNY6MiLt9hONw== X-Received: by 2002:a17:906:fe08:b0:9a1:e0b1:e919 with SMTP id wy8-20020a170906fe0800b009a1e0b1e919mr13143233ejb.4.1696938689797; Tue, 10 Oct 2023 04:51:29 -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 p26-20020a1709060dda00b009b2cc87b8c3sm8256010eji.52.2023.10.10.04.51.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 10 Oct 2023 04:51:29 -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 6/6] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req() Date: Tue, 10 Oct 2023 13:50:48 +0200 Message-ID: <20231010115048.11856-7-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::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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 --- 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;