diff mbox series

[1/3] hw/core/machine: Clean up local variable shadowing

Message ID 20230904162824.85385-2-philmd@linaro.org
State Superseded
Headers show
Series (few more) Steps towards enabling -Wshadow [3 more] | expand

Commit Message

Philippe Mathieu-Daudé Sept. 4, 2023, 4:28 p.m. UTC
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(-)

Comments

Peter Maydell Sept. 4, 2023, 4:32 p.m. UTC | #1
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
diff mbox series

Patch

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);