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;