From: Philippe Mathieu-Daudé Date: Mon, 4 Sep 2023 16:12:32 +0000 (+0200) Subject: sysemu/device_tree: Clean up local variable shadowing X-Git-Tag: v8.2.0-rc0~96^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=720d6bcdbb9fd6781025f245c8d02ce179a2fc86;p=thirdparty%2Fqemu.git sysemu/device_tree: Clean up local variable shadowing 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é Message-ID: <20230904161235.84651-21-philmd@linaro.org> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index ca5339beae8..8eab3959341 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)); \