* [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more]
@ 2023-09-04 16:28 Philippe Mathieu-Daudé
2023-09-04 16:28 ` [PATCH 1/3] hw/core/machine: Clean up local variable shadowing Philippe Mathieu-Daudé
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-04 16:28 UTC (permalink / raw)
To: qemu-devel, Markus Armbruster
Cc: qemu-block, qemu-arm, Philippe Mathieu-Daudé
Just missed while posting v2 eh :/
(https://lore.kernel.org/qemu-devel/20230904161235.84651-1-philmd@linaro.org/)
Philippe Mathieu-Daudé (3):
hw/core/machine: Clean up local variable shadowing
hw/intc/openpic: Clean up local variable shadowing
tests/qtest/pflash: Clean up local variable shadowing
hw/core/machine.c | 2 --
hw/intc/openpic.c | 7 ++-----
tests/qtest/pflash-cfi02-test.c | 2 +-
3 files changed, 3 insertions(+), 8 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] hw/core/machine: Clean up local variable shadowing
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é
2023-09-04 16:32 ` Peter Maydell
2023-09-04 16:28 ` [PATCH 2/3] hw/intc/openpic: " Philippe Mathieu-Daudé
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-04 16:28 UTC (permalink / raw)
To: qemu-devel, Markus Armbruster
Cc: qemu-block, qemu-arm, Philippe Mathieu-Daudé,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] hw/intc/openpic: Clean up local variable shadowing
2023-09-04 16:28 [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Philippe Mathieu-Daudé
2023-09-04 16:28 ` [PATCH 1/3] hw/core/machine: Clean up local variable shadowing Philippe Mathieu-Daudé
@ 2023-09-04 16:28 ` 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-29 5:15 ` [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Markus Armbruster
3 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-04 16:28 UTC (permalink / raw)
To: qemu-devel, Markus Armbruster
Cc: qemu-block, qemu-arm, Philippe Mathieu-Daudé,
Mark Cave-Ayland
Fix:
hw/intc/openpic.c: In function ‘openpic_gbl_write’:
hw/intc/openpic.c:614:17: warning: declaration of ‘idx’ shadows a previous local [-Wshadow=compatible-local]
614 | int idx;
| ^~~
hw/intc/openpic.c:568:9: note: shadowed declaration is here
568 | int idx;
| ^~~
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/intc/openpic.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
index c757adbe53..a6f91d4bcd 100644
--- a/hw/intc/openpic.c
+++ b/hw/intc/openpic.c
@@ -610,11 +610,8 @@ static void openpic_gbl_write(void *opaque, hwaddr addr, uint64_t val,
case 0x10B0:
case 0x10C0:
case 0x10D0:
- {
- int idx;
- idx = (addr - 0x10A0) >> 4;
- write_IRQreg_ivpr(opp, opp->irq_ipi0 + idx, val);
- }
+ idx = (addr - 0x10A0) >> 4;
+ write_IRQreg_ivpr(opp, opp->irq_ipi0 + idx, val);
break;
case 0x10E0: /* SPVE */
opp->spve = val & opp->vector_mask;
--
2.41.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] tests/qtest/pflash: Clean up local variable shadowing
2023-09-04 16:28 [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Philippe Mathieu-Daudé
2023-09-04 16:28 ` [PATCH 1/3] hw/core/machine: Clean up local variable shadowing Philippe Mathieu-Daudé
2023-09-04 16:28 ` [PATCH 2/3] hw/intc/openpic: " Philippe Mathieu-Daudé
@ 2023-09-04 16:28 ` 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
3 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-04 16:28 UTC (permalink / raw)
To: qemu-devel, Markus Armbruster
Cc: qemu-block, qemu-arm, Philippe Mathieu-Daudé, Thomas Huth,
Laurent Vivier, Paolo Bonzini
Fix:
tests/qtest/pflash-cfi02-test.c: In function ‘test_geometry’:
tests/qtest/pflash-cfi02-test.c:409:22: warning: declaration of ‘byte_addr’ shadows a previous local [-Wshadow=compatible-local]
409 | uint64_t byte_addr = (uint64_t)i * c->sector_len[region];
| ^~~~~~~~~
tests/qtest/pflash-cfi02-test.c:342:14: note: shadowed declaration is here
342 | uint64_t byte_addr = 0;
| ^~~~~~~~~
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
tests/qtest/pflash-cfi02-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qtest/pflash-cfi02-test.c b/tests/qtest/pflash-cfi02-test.c
index 0b52c2ca5c..8c073efcb4 100644
--- a/tests/qtest/pflash-cfi02-test.c
+++ b/tests/qtest/pflash-cfi02-test.c
@@ -406,7 +406,7 @@ static void test_geometry(const void *opaque)
for (int region = 0; region < nb_erase_regions; ++region) {
for (uint32_t i = 0; i < c->nb_blocs[region]; ++i) {
- uint64_t byte_addr = (uint64_t)i * c->sector_len[region];
+ byte_addr = (uint64_t)i * c->sector_len[region];
g_assert_cmphex(flash_read(c, byte_addr), ==, bank_mask(c));
}
}
--
2.41.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] hw/core/machine: Clean up local variable shadowing
2023-09-04 16:28 ` [PATCH 1/3] hw/core/machine: Clean up local variable shadowing Philippe Mathieu-Daudé
@ 2023-09-04 16:32 ` Peter Maydell
0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2023-09-04 16:32 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Markus Armbruster, qemu-block, qemu-arm,
Eduardo Habkost, Marcel Apfelbaum, Yanan Wang
On Mon, 4 Sept 2023 at 17:28, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> 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>
> ---
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] hw/intc/openpic: Clean up local variable shadowing
2023-09-04 16:28 ` [PATCH 2/3] hw/intc/openpic: " Philippe Mathieu-Daudé
@ 2023-09-04 16:33 ` Peter Maydell
0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2023-09-04 16:33 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Markus Armbruster, qemu-block, qemu-arm,
Mark Cave-Ayland
On Mon, 4 Sept 2023 at 17:28, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Fix:
>
> hw/intc/openpic.c: In function ‘openpic_gbl_write’:
> hw/intc/openpic.c:614:17: warning: declaration of ‘idx’ shadows a previous local [-Wshadow=compatible-local]
> 614 | int idx;
> | ^~~
> hw/intc/openpic.c:568:9: note: shadowed declaration is here
> 568 | int idx;
> | ^~~
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] tests/qtest/pflash: Clean up local variable shadowing
2023-09-04 16:28 ` [PATCH 3/3] tests/qtest/pflash: " Philippe Mathieu-Daudé
@ 2023-09-04 16:34 ` Peter Maydell
0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2023-09-04 16:34 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Markus Armbruster, qemu-block, qemu-arm, Thomas Huth,
Laurent Vivier, Paolo Bonzini
On Mon, 4 Sept 2023 at 17:30, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Fix:
>
> tests/qtest/pflash-cfi02-test.c: In function ‘test_geometry’:
> tests/qtest/pflash-cfi02-test.c:409:22: warning: declaration of ‘byte_addr’ shadows a previous local [-Wshadow=compatible-local]
> 409 | uint64_t byte_addr = (uint64_t)i * c->sector_len[region];
> | ^~~~~~~~~
> tests/qtest/pflash-cfi02-test.c:342:14: note: shadowed declaration is here
> 342 | uint64_t byte_addr = 0;
> | ^~~~~~~~~
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more]
2023-09-04 16:28 [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2023-09-04 16:28 ` [PATCH 3/3] tests/qtest/pflash: " Philippe Mathieu-Daudé
@ 2023-09-29 5:15 ` Markus Armbruster
3 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2023-09-29 5:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel, qemu-block, qemu-arm
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> Just missed while posting v2 eh :/
> (https://lore.kernel.org/qemu-devel/20230904161235.84651-1-philmd@linaro.org/)
PATCH 3 has become commit 82fdcd3e140c8d4c63f177ece554f90f2bccdf68.
Remainder queued. Thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-09-29 5:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-04 16:28 [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] Philippe Mathieu-Daudé
2023-09-04 16:28 ` [PATCH 1/3] hw/core/machine: Clean up local variable shadowing Philippe Mathieu-Daudé
2023-09-04 16:32 ` 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
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).