From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Yanan Wang" <wangyanan55@huawei.com>
Subject: [PATCH 1/3] hw/core/machine: Clean up local variable shadowing
Date: Mon, 4 Sep 2023 18:28:22 +0200 [thread overview]
Message-ID: <20230904162824.85385-2-philmd@linaro.org> (raw)
In-Reply-To: <20230904162824.85385-1-philmd@linaro.org>
Fix:
hw/core/machine.c: In function ‘machine_initfn’:
hw/core/machine.c:1081:17: warning: declaration of ‘obj’ shadows a parameter [-Wshadow=compatible-local]
1081 | Object *obj = OBJECT(ms);
| ^~~
hw/core/machine.c:1065:36: note: shadowed declaration is here
1065 | static void machine_initfn(Object *obj)
| ~~~~~~~~^~~
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/core/machine.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index da699cf4e1..7adc3d4e13 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1078,8 +1078,6 @@ static void machine_initfn(Object *obj)
ms->maxram_size = mc->default_ram_size;
if (mc->nvdimm_supported) {
- Object *obj = OBJECT(ms);
-
ms->nvdimms_state = g_new0(NVDIMMState, 1);
object_property_add_bool(obj, "nvdimm",
machine_get_nvdimm, machine_set_nvdimm);
--
2.41.0
next prev parent reply other threads:[~2023-09-04 16:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 16:28 [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Philippe Mathieu-Daudé
2023-09-04 16:28 ` Philippe Mathieu-Daudé [this message]
2023-09-04 16:32 ` [PATCH 1/3] hw/core/machine: Clean up local variable shadowing Peter Maydell
2023-09-04 16:28 ` [PATCH 2/3] hw/intc/openpic: " Philippe Mathieu-Daudé
2023-09-04 16:33 ` Peter Maydell
2023-09-04 16:28 ` [PATCH 3/3] tests/qtest/pflash: " Philippe Mathieu-Daudé
2023-09-04 16:34 ` Peter Maydell
2023-09-29 5:15 ` [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230904162824.85385-2-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=armbru@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).