[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/11] sysemu/device_tree: Clean up local variable shadowing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 11/11] sysemu/device_tree: Clean up local variable shadowing |
Date: |
Fri, 1 Sep 2023 00:56:06 +0200 |
Fix:
hw/mips/boston.c:472:5: error: declaration shadows a local variable
[-Werror,-Wshadow]
qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size);
^
include/sysemu/device_tree.h:129:13: note: expanded from macro
'qemu_fdt_setprop_cells'
int i;
^
hw/mips/boston.c:461:9: note: previous declaration is here
int i;
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/sysemu/device_tree.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h
index ca5339beae..8eab395934 100644
--- a/include/sysemu/device_tree.h
+++ b/include/sysemu/device_tree.h
@@ -126,10 +126,8 @@ int qemu_fdt_add_path(void *fdt, const char *path);
#define qemu_fdt_setprop_cells(fdt, node_path, property, ...) \
do { \
uint32_t qdt_tmp[] = { __VA_ARGS__ }; \
- int i; \
- \
- for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) { \
- qdt_tmp[i] = cpu_to_be32(qdt_tmp[i]); \
+ for (unsigned i_ = 0; i_ < ARRAY_SIZE(qdt_tmp); i_++) { \
+ qdt_tmp[i_] = cpu_to_be32(qdt_tmp[i_]); \
} \
qemu_fdt_setprop(fdt, node_path, property, qdt_tmp, \
sizeof(qdt_tmp)); \
--
2.41.0
- Re: [PATCH 01/11] tcg: Clean up local variable shadowing, (continued)
- [PATCH 02/11] target/arm: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 03/11] target/mips: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 04/11] target/m68k: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 05/11] hw/arm/virt: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 06/11] hw/arm/allwinner: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 07/11] hw/arm/aspeed: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 08/11] hw/m68k: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 09/11] hw/ide/ahci: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 10/11] net/eth: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 11/11] sysemu/device_tree: Clean up local variable shadowing,
Philippe Mathieu-Daudé <=