diff mbox series

[v2,21/22] softmmu/memory: Clean up local variable shadowing

Message ID 20230904161235.84651-22-philmd@linaro.org
State New
Headers show
Series (few more) Steps towards enabling -Wshadow | expand

Commit Message

Philippe Mathieu-Daudé Sept. 4, 2023, 4:12 p.m. UTC
Fix:

  softmmu/memory.c: In function ‘mtree_print_mr’:
  softmmu/memory.c:3236:27: warning: declaration of ‘ml’ shadows a previous local [-Wshadow=compatible-local]
   3236 |         MemoryRegionList *ml;
        |                           ^~
  softmmu/memory.c:3213:32: note: shadowed declaration is here
   3213 |     MemoryRegionList *new_ml, *ml, *next_ml;
        |                                ^~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 softmmu/memory.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Peter Xu Sept. 5, 2023, 3:46 p.m. UTC | #1
On Mon, Sep 04, 2023 at 06:12:33PM +0200, Philippe Mathieu-Daudé wrote:
> Fix:
> 
>   softmmu/memory.c: In function ‘mtree_print_mr’:
>   softmmu/memory.c:3236:27: warning: declaration of ‘ml’ shadows a previous local [-Wshadow=compatible-local]
>    3236 |         MemoryRegionList *ml;
>         |                           ^~
>   softmmu/memory.c:3213:32: note: shadowed declaration is here
>    3213 |     MemoryRegionList *new_ml, *ml, *next_ml;
>         |                                ^~
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Peter Xu <peterx@redhat.com>
diff mbox series

Patch

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 7d9494ce70..bf48350438 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -3233,7 +3233,6 @@  static void mtree_print_mr(const MemoryRegion *mr, unsigned int level,
     }
 
     if (mr->alias) {
-        MemoryRegionList *ml;
         bool found = false;
 
         /* check if the alias is already in the queue */